Scripsit Andreas Prilop:
>is there any way to
specify that an element in a page should ignore all CSS properties
that have been defined for it, and to adopt some form of browser
default?
Ah! Do you mean something like
http://www.w3.org/TR/REC-CSS2/cascad...ue-def-inherit
?
No, that would be something completely different. (The allusion to Monty
Python is intentional.)
The value inherit means (by the specifications, which are ignored by IE in
this matter) that the value of a property is copied - by certain rules,
with some surprises - from the value of the property for the "parent"
(immediately enclosing element) of the current element.
This is quite distinct from adopting a browser default. Inheritance is, by
definition, applicable only when _no_ style sheet being used sets a value
for a property of an element.
To take a simple example, a browser may well have some monospace font as its
default font for <preor <textareaelements. Actually, that's more or less
the recommendation for <pre>. If you set pre, textarea { font-family:
inherit; }, then you are _not_ telling the browser to use its default. Quite
on the contrary, you are overriding the browser default and telling the
browser to use the font-family value of the "parent" of the <textarea>
element. This is typically <divor <form>, which usually has no font-family
setting, so it inherits it etc., and we probably come up to the settings for
<body>. Thus, the effect is _typically_ that the browser default for the
_overall_ font-family is used, not the browser default for the specific
element. And, of course, if any intermediate element between <preor
<textareaand <bodyhas its own font-family setting, from whichever style
sheet, it breaks the chain of inheritance.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/