Dilated Posted July 16, 2010 Share Posted July 16, 2010 I've googled this and couldn't find anything. I'll try to explain my problem in an example:Stylesheet would look like this: div { margin: 5px auto 5px auto; } table { margin: 5px auto 5px auto; } And the page's body would look like this: <div>stuff here</div> <table><tr><td>other stuff here</td></tr></table> <div>another div here</div> <div>and another div here</div> What I've noticed is that div margins seem to overlap. The space between the last 2 divs will be 5 pixels, and the space between one of the divs and the table will be 10px.What is the reason for this inconsistency? BTW, I've only seen this happen with firefox so far, I haven't tried any other browser. Link to comment Share on other sites More sharing options...
Ingolme Posted July 16, 2010 Share Posted July 16, 2010 Given your code, I'd expect there to be 10 pixels between all the elements. Can you show us a test page that displays otherwise? Link to comment Share on other sites More sharing options...
dsonesuk Posted July 16, 2010 Share Posted July 16, 2010 The margins look fine between divs, the extra spacing between div and table is because you have not taken into account the spacing from cellpadding and cellspacing which is set by default to tables. Link to comment Share on other sites More sharing options...
Dilated Posted July 16, 2010 Author Share Posted July 16, 2010 Thanks for the replies.There must be some other problem with my stylesheet that I'm overlooking, but I did manage to get the margins the way I wanted them. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.