Spartanicus <in*****@invalid.invalid> wrote:
"Xah Lee" <xa*@xahlee.org> wrote:
is there somewhere i can find the default css for browsers?
No such thing. They all use different default styles.
Besides, they have presentational idiosyncrasies that are not describable
in CSS, and they may have failed to present their default style sheet (real
or virtual) to the public. For example, for IE, we need to infer things
from the browser's behavior. It's more difficult than you might think,
since the rendering of an element depends on context. (For example,
vertical margins for elements may disappear if the element is the content
of a table cell - rather naturally, but it complicates things.)
That said, w3c published a sample default stylesheet
http://www.w3.org/TR/REC-CSS2/sample.html
That sample stylesheet makes obscure claims on describing carefully the
actual browser behavior _and_ on recommending how browsers should behave.
Don't rely on it at all, though you might use it as a checklist of things
that browsers _might_ do and you _might_ wish to do.
(Besides, CSS 2 is effectively dead and CSS 2.1 isn't born yet. Not
surprisingly, the sample style sheets in CSS 1, CSS 2, and CSS 2.1 are
all different, in essential ways.)
The morale is that when writing an author style sheet, you should be
prepared to anything reasonably imaginable in browsers' default style
sheets, and somewhat more. For example, if you would like to make the
indentation of list smaller than what browsers typically use, you should
set all of the following: padding-left and margin-left for the list element
(ul or ol) and for the list item elements (li). You cannot know, or you
should at least pretend you don't know, which of them a browser uses for
the indentation. So if you naively just set e.g. margin-left: 1.5em for
a ul element, you might actually _increase_ the nesting, on browsers that
by default use padding-left to create considerable indentation (and
default margin-left to zero).
--
Yucca,
http://www.cs.tut.fi/~jkorpela/