What's the standard margin of a <p> element?
We're using a Html Wrapper supplied by a client, which references a reset style sheet that sets the <p>
element's margin to 0px. I'd like to have a normal top开发者_运维知识库 & bottom margin with my <p>
elements, so can somebody tell me what it should be?
Browser specific CSS defaults are outlined here.
Here's an extract of relevance for the margin of the p
element:
- W3:
1.12em 0
- IE7:
14.25pt 0
- IE8:
1em 0
- FF2:
1em 0
- FF3:
1em 0
- Opera:
1em 0
- Safari 3.1:
1em 0
Reset stylesheets are by the way ridiculous. Just set the desired margin yourself if you want it to be consistent among browsers.
p {
margin: .75em 0;
}
See also:
- Are padding and margin most disbalanced among browsers?
They're browser dependent. That's why most people use a reset sheet - to normalize them before they attempt to customize them.
The default margin is 1em
, as suggested in HTML5.
精彩评论