Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the standard margin of a <p> element?

Tags:

html

css

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?

like image 857
DaveDev Avatar asked Jul 16 '10 15:07

DaveDev


1 Answers

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?
like image 55
BalusC Avatar answered Oct 10 '22 07:10

BalusC