sepoto Posted February 15, 2011 Share Posted February 15, 2011 I have seen a lot of discussion about this topic and a lot of different solutions. Is there a good cross browser compatible way to get the space above and below the <div> to be 0px?Thank you! Link to comment Share on other sites More sharing options...
dsonesuk Posted February 15, 2011 Share Posted February 15, 2011 preset all elements margins, and padding to 0 using universal selector '*' as in * {margin:0; padding:0;}, or for just targeting div elements div {margin:0; padding:0;}.if you are talking about div elements taking the margins from the children elements within it, such as paragraphs and header tags that is cause by the collapsing margins problem, which is discussed here Collapsing Margins . I generally use the overflow hidden, or on rare occasions 1px padding, to fix this problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.