SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Removing unwanted space

  1. #1
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing unwanted space

    Hi, i m working a website and there a maroon line throughout the page and below it are three boxes. now i have two issues.
    1.i want the top of the boxes to touch with the bottom of maroon line.the maroon line have a margin-bottom:3px; i tried to remove it but still it won't get connected with top of the boxes.
    2. I have 3 boxes with border of left and right. i want the right border of the 1st box connect with left side of the 2nd box. now its making it look thick as its 1px but both residing side by side it makes 2px. how can i make them look like its 1px?

    Thanks in advance.
    All those who wander aren't lost.

  2. #2
    Just Blow it! bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    6,701
    Mentioned
    54 Post(s)
    Tagged
    1 Thread(s)
    1. The problem isn't just the margin-bottom on the sep div. It's the negative top margin as well, which can be resolved by reducing the height of the slider class to 269px, and removing the top and bottom margins from the sep div.
    2. Just set the left border for qLinks (which should be a class, not an ID since you've got three of them on the page), then on the far right div, add an additional class which has the right border defined (ex. div class="qLinks lastLink").


    If I could make an additional suggestion - float your images (the ones with class size-[auto|full|large|medium] ) with a margin-right and margin-bottom of say 1em which will allow the text in those divs to wrap around the images and make them much easier to read.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  3. #3
    SitePoint Mentor bronze trophy
    chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,041
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nofel View Post
    1.i want the top of the boxes to touch with the bottom of maroon line.the maroon line have a margin-bottom:3px; i tried to remove it but still it won't get connected with top of the boxes.
    I had a look at your CSS source and your #sep selector still has a bottom margin as well as a negative top margin which is the reason for the space as well, anytime your negatively offset an element the DOM node itself stays put but the element moves so you need to be careful when using margins. What you really need to do is wrap your left and right columns in a parent and set some padding on the right column as the way your markup is currently will make it EXTREMELY difficult to maintain and update your website.

    Quote Originally Posted by nofel View Post
    2. I have 3 boxes with border of left and right. i want the right border of the 1st box connect with left side of the 2nd box. now its making it look thick as its 1px but both residing side by side it makes 2px. how can i make them look like its 1px?
    You could simply use border-right and then use the :first-child selector to set the left border on the first box.

    Code CSS:
    .box {
        border-right: 1px solid #000;
    }
     
    .box:first-child { border-left: 1px solid #000; }
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  4. #4
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guy, that solution of dropping the margins and :first-child, solved my problem. u guys are ninja's.
    thanks!
    All those who wander aren't lost.

  5. #5
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you look at the website. the last box right border isn't working
    All those who wander aren't lost.

  6. #6
    Just Blow it! bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    6,701
    Mentioned
    54 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nofel View Post
    If you look at the website. the last box right border isn't working
    That's because you didn't do as he suggested - you put the border-left on the qLinks, then the border-right on the first child.

    And I'll repeat what I said earlier - you REALLY need to change the ID="qLinks" to class="qLinks" on those divs, then change the #qLinks to .qLinks. If you have more than one element to apply a common style to, then you use classes, not ids. There should only be one id with a name in an HTML markup page.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  7. #7
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought the id's won't do much problem coz i m using wordpress and it uses a lot of ID in just one page.anyhow i changed it, sorry for before i overlooked. but now the first line has been appended to last box and gone from first box.
    All those who wander aren't lost.

  8. #8
    Just Blow it! bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    6,701
    Mentioned
    54 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nofel View Post
    I thought the id's won't do much problem coz i m using wordpress and it uses a lot of ID in just one page.anyhow i changed it, sorry for before i overlooked. but now the first line has been appended to last box and gone from first box.
    To be honest, I don't use the child stuff since I have problems with it. I personally would just use an additional class and add that class onto the first div. See my example in post #2.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  9. #9
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well i applied 3 different class to every 3 box with different border and it worked.
    All those who wander aren't lost.

  10. #10
    Just Blow it! bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    6,701
    Mentioned
    54 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nofel View Post
    well i applied 3 different class to every 3 box with different border and it worked.
    Well, I'm glad you got it working, but you didn't need three classes - just two. If you apply qLinks2 to that last div, change the first div to be <div class="qLinks qLinks2">, and remove the border-right from .qLinks, you'll get the same look. Your choice, but it might save some work later on if you want to make changes to the color, width, style, etc of the border.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  11. #11
    Goofy nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes u r right. thanks for the heads up. although i think the picture on the right side is somewhat cutting off. i guess
    All those who wander aren't lost.

  12. #12
    Just Blow it! bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    6,701
    Mentioned
    54 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nofel View Post
    yes u r right. thanks for the heads up. although i think the picture on the right side is somewhat cutting off. i guess
    It is because the image is wider than the div that it's in (204px vs 176px). You'd need to widen the div, which would require you to either a) widen the width of the main div or b) reduce the width of the slider div. Personally, I'd reduce the width of the slider div since the page looks a little large for me. The only reason that slider div is that wide is that one image which doesn't look to be there.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •