Spaces Between Divs

Discussion in 'HTML & Website Design' started by Mattero, Dec 16, 2009.

  1. #1
    Sometimes when I am making a site from scratch, and I am coding the html/css.. I then view it in a browser (firefox and IE) there are white spaces between either my navigation (if its horizontal) and content and then content and footer.

    The only way I seem to be able to fix this is just starting over and normally it doesnt show up after that for some weird reason. (Not sure how just re typing all the code in a new document fixes it but what ever floats the web browsers boat)

    Anyone know what could be happening?
     
    Mattero, Dec 16, 2009 IP
  2. masterofweb

    masterofweb Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    use style clear:both betwwn 2 divs
     
    masterofweb, Dec 17, 2009 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can also try and use floats as well as parent containers.
     
    LeetPCUser, Dec 17, 2009 IP
  4. FinalHuntMedia

    FinalHuntMedia Peon

    Messages:
    180
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It can also depend on what you are using to edit or write your code...

    Sometimes a line-return, depending on what you are using, will, by default, enter a " " on output which equates to a space...

    Another possibility is default padding / margin spacing.

    Another is as stated above, floating + position rendering in certain browsers.

    Without explicit details on your process, it is hard to determine specifically the issue...
     
    FinalHuntMedia, Dec 17, 2009 IP
  5. tinker2

    tinker2 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It`s usually a css problem. Maybe the p or div tag has some properties causing whatever is going on.
     
    tinker2, Dec 17, 2009 IP
  6. believer1984

    believer1984 Peon

    Messages:
    1,544
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This works as a spacer for me, especially needed when adding my content.

    <div style="width:30px;">&nbsp;</div>

    (Change width if you like)
     
    believer1984, Dec 17, 2009 IP
  7. wwwsolution

    wwwsolution Guest

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think it is style problem mostly the possible cause is 'Padding' property. please check 'padding' property. also depend on what you are using to edit or write your code.
     
    wwwsolution, Dec 18, 2009 IP
  8. sanych

    sanych Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I have made padding:0; for all my divs, because FF, Opera and IE calculate the div`s padding differently.
     
    sanych, Dec 19, 2009 IP
  9. stejas

    stejas Guest

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I think it will be best if you show the code; else everyone will be guessing about the problem
     
    stejas, Dec 19, 2009 IP
  10. m7md_cis

    m7md_cis Peon

    Messages:
    91
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Try margin and padding properties in css.
     
    m7md_cis, Dec 20, 2009 IP