|
Posted by Jukka K. Korpela on 09/01/06 12:22
Andy Dingley <dingbat@codesmiths.com> scripsit:
> Marc wrote:
>
>> Anyway, my question is this: what is the default padding and margin
>> on <p>? Does it vary between browsers?
>
> Who knows? You'd have to ask the browser makers
Indeed. But it surely varies between browsers.
> This isn't the best source to use anyway - as you're implementing an
> "any browser" solution, then starting from a specific browser could be
> misleading. Better to aim at a true "default", although obviously that
> can only be a guide, not a definitive statement.
I don't think we should worry too much about a "default", if we are changing
the styling anyway. But we should set both margin and padding if we set one
of them; Marc actually referred to this in the original question, by
mentioning both properties. Otherwise we would take the risk of setting some
margin and getting more spacing just because some browser has a default
nonzero padding, or vice versa.
> Here's the W3C one
> http://www.w3.org/TR/CSS21/sample.html
>
> p { margin: 1.12em 0 }
Well, the "sample style sheet for HTML 4.0" is largely misleading. It
presents itself as both descriptive ("based on extensive research into
current UA practice") and prescriptive ("Developers are encouraged to use it
as a default style sheet"). In reality, it fails on both accounts. It's a
mess, a mixture of common defaults, wishful thinking, and bad ideas.
The fancy number 1.12em reflects an assumed line height of 1.12, which is
too small for commonly used fonts like Arial and which corresponds to actual
browser defaults only by accident. On the other hand, do we really need an
empty line's worth of spacing?
Marc seems to want to revert to "normal" margins for paragraphs inside an
element, assuming that some specific setting applies to the page as a whole.
That's a quite reasonable request, except that it's impossible in CSS as
currently defined.
But setting e.g.
#content p { margin: 1em 0; padding: 0; }
should work reasonably. We don't need any specific default but something
reasonably normal. Instead 1em, you can use a somewhat different value.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Navigation:
[Reply to this message]
|