Jump to content

Space above and below <div>.


sepoto
 Share

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.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...