Jump to content

Space above and below <div>.


sepoto

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...