Thursday, August 8, 2013

margin: 0; and margin: 0px; are not the same

If you have the former on the html tag, body tag, and a div that wraps everything, you may then put margin-top: 20px; in a nested child div and you will end up putting 20 pixel of white space BEFORE (above) the outermost div wrapping everything. The effect somehow cascades up. I don't get it and I don't want to think about it right now. (I'm in a hackathon.) I am only using margin: 0; because it was in an example I found on the web for an iPhone-friendly HTML5 app. I am, as suggested here, putting this setting on both the outermost html css tag and the body tag.

No comments:

Post a Comment