sawade Posted August 11, 2009 Share Posted August 11, 2009 There is space between two div layers, how ever I have zeroed out the margin and padding on both. And yet there is still space. Why are they not collapsing into each other? <body> <div id="body"> <div id="header"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; width: 800px; margin-left: auto; margin-right: auto; line-height: 1.7em; margin-top: 0; } #body { background-color: #EEE8CD; border: medium #3D627F solid; padding-bottom: 0; margin-bottom: 0; } #header { margin-top: 0; padding-top: 0; text-align: left; background: #3D627F url(images/medwww.gif) top right no-repeat; } Thanks. Quote Link to comment Share on other sites More sharing options...
sawade Posted August 11, 2009 Author Share Posted August 11, 2009 image of the problem [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 12, 2009 Share Posted August 12, 2009 * { margin: 0; padding: 0; } You should always declare this somewhere in your css styling. EDIT: Do you have firebug installed? If not... GET IT. Quote Link to comment Share on other sites More sharing options...
sawade Posted August 12, 2009 Author Share Posted August 12, 2009 * { margin: 0; padding: 0; } You should always declare this somewhere in your css styling. EDIT: Do you have firebug installed? If not... GET IT. I have tried that. It does solve the space issue. But all it does is create even more issues. Using it eliminates ALL other spacing in the entire HTML doc. Including spacing between paragraphs, lists, other defined margins, paddings, etc etc. All text is completely squashed together, very unattractive. So that code doesn't solve this issue. Thanks. Quote Link to comment Share on other sites More sharing options...
haku Posted August 12, 2009 Share Posted August 12, 2009 I prefer a CSS reset sheet over the method theFilmGod showed there, but that being said, his method is the next best thing (or the better thing, depending on who you ask). It does two things: 1) It starts all browsers off on equal footing, whereas without it, they will each have their own defaults 2) It forces you to set everything manually, to make sure it's exactly the way you want. So, that being said, put the code he suggested at the very start of your CSS, then set everything manually after. It's a pain in the ass, but it's the better way of doing everything. Or, if you REALLY don't want to do that (which really isn't a good idea), then try posting more of your code than you did. You didn't even show the closing tags for the divs you posted, or what was in them, or anything. We cannot guess what your code looks like. Quote Link to comment Share on other sites More sharing options...
sawade Posted August 12, 2009 Author Share Posted August 12, 2009 Well Haku I took the advice and used the universal. And spent the extra time resetting all the margins and paddings for all elements. Wasn't how I wanted to spend my morning, but it looks like it did before. Quote Link to comment Share on other sites More sharing options...
haku Posted August 13, 2009 Share Posted August 13, 2009 Glad to hear. But, it's not like you will have to do that every time, just make sure that with future sites, a reset is the first thing you start with. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.