Sent by Jukka K. Korpela on 6 September 2004 07:07
On Sun, 5 Sep 2004, Big John wrote:
> > > Are default vertical margins specified anywhere,
> > > and if so, where?
>
> Lachlan Hunt wrote:
> > Yes, in Appendix A of the CSS2 spec [1]. It's only informative, so it
> > is only a guideline, thus browsers don't need to conform to it fully
> > (and indeed, no browser I know of does).
- -
> So Opera is "violating" this guideline with regard to the lower
> default margins,
As Lachlan Hunt wrote (in a message that hasn't reached me, for some
reason, but was quoted so that I guess I got the main point),
the appendix is _informative_. Its status is admittedly vague -
the text recommends that browser vendors use it as default style sheet,
on one hand, and claims that it is based on extensive research of browser
behavior. In reality, it is a strange mixture of features that correspond
to actual browser behavior and suggestions that have been (often for good
reasons) completely ignored, and things in between.
The practical conclusion is that appendix A should not be relied upon in
authoring. But it might be useful reading as regards to what browsers
_might_ do and what kinds of default settings for various properties for
various elements there _might_ be. This might make you consider whether
you wish to override some of them in your style sheet.
> Usually Opera tries to adhere to the standards, at least when
> they aren't emulating IE. This seems rather arbitrary.
Appendix A is rather arbitrary. And a browser should not be criticized for
not adhering to a "standard" in an issue where the "standard" explicitly
labels its appendix as _informative_.
Regarding the default margins, appendix A sets quite a few of them; I
don't know whether Lachlan Hunt quoted them all, but the elements for
which appendix A sets at least some margins nonzero, are
- headings (h1 thru h6)
- paragraphs (p)
- block quotations (blockquote)
- lists (ul, ol, dl, dir, menu)
- forms (form)
- field sets (fieldset).
This mostly corresponds to actual browser behavior, more or less,
including the use of pixel valued left margins (40px) for lists (which is
against the principle of scaleability to font size and causes trouble even
with fairly normal font sizes e.g. for <ol> lists containing large item
numbers). However, browsers often leave a margin _below_ an element but
not _above_ it, though this typically gets unnoticed since the preceding
element has a bottom margin.
Appendix A sets no default margin for body, but it sets its padding
to 8px. Note that for some reason there are no default margins for table
elements, so if you have e.g. two tables in succession, they touch each
other.
In browser behavior, there are some specialities at least inside tables.
For example, <td><p>...</p></td> often does not result in any margins
above and below the p element. This is probably what authors actually
prefer.
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/