The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: CSS - Space between divs

  1. #1

    CSS - Space between divs

    Here's a silly question. How do you eliminate the space between sections that have different div id's?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled-1 copy.jpg 
Views:	58 
Size:	59.0 KB 
ID:	19961  

  2. #2
    Do you have the margins set to 0px?

  3. #3

  4. #4
    could u show us the code ?

  5. #5
    If you are viewing it in IE, sometimes IE always needs to have padding: 0px; margin 0px;

    Otherwise, it's in your XHTML code. Try to get us some links so we can better hlep you.

  6. #6

    CSS is valid, but XHTML is not.

    Sidenote- Those of you using IE, are the png border drop shadows transparent?

  7. #7
    its the heading tags. They aren't normal block tags; they are more like paragraph tags. You can use divs instead or set display to inline to prevent the breakup.

  8. #8
    Confused. Everything is divs, as such:
    HTML Code:
    <div id="blabla">content</div>

  9. #9
    h1, h2 etc. These are header tags. Make those divs or spans. Either that or just keep them completely within a container div where they're line breaks wont interfere with the layout

  10. #10
    I was going to ask about that, but the most pressing issue is between the "header" div and the "content" div, as well as between the "headerbody" and the "centerbody". Those gaps in the blue...

  11. #11
    yes, thats from the header tags. Ditch-em

  12. #12
    But I need those tags to set the background images on those sections... The blue stuff. I can't put the text and the image in the same div because i have to put a left margin for the text...

  13. #13
    Listen, the problem is the header tags. As I said before you need to either
    A) REPLACE the header tags with something like div or span tags and style them to format your text comparatively


    B) SET your header tags to have a display type of inline, i.e.
    HTML Code:
    h1, h2, h3 {
    I suggest A. Just go through your HTML and replace your h1, h2 and other h tags with div or spans and style them as needed. Easy, problem solved.

    This isnt changing your images (they are added through the other divs) and besides, you'd be replacing them with "better" tags so all you're losing is the awkward line jump.

    p.s. the header tags and that pointless paragraph (p) tag you have in there too. As with when I was comparing header tags to p tags; both supply the extra line in their layout.

  14. #14
    Yay it worked! I love you sen!

  15. #15

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012