HTML and CSS Reference
In-Depth Information
Media: visual
Computed value: the computed color(s)
Confusing? It can be. So, what do we need to understand from all this? And
why is it relevant to inheritance?
Let's go back to the first sentence of this section, which should make more
sense now. When an element inherits a value from its parent, it inherits its
computed value . Because the computed value exists even if it isn't specified
in the style sheet, a property can be inherited even then: the initial value will
be used. So, you can make use of inheritance even if the parent doesn't
have a specified property.
3.3 USING INHERITANCE
The most important thing to know about inheritance is that it's there and
how it works. If you ignore the jargon, inheritance is actually very
straightforward.
Imagine you had to specify the font-size or font-family of every
element, instead of simply adding it to the body element? That would
cumbersome, which is why inheritance is so helpful.
Don't break it by using the universal selector ( * ) with properties that inherit
by default. Bobby Jack wrote an interesting post about this on his Five-
Minute Argument blog. You don't have to remember all of the properties
that inherit, but you will in time.
Rarely does a CSS-related article not bring some kind of bad news about
Internet Explorer. This article is no exception. IE supports the inherit value
only from version 8, except for the direction and visibility
properties. Great.
Search WWH ::




Custom Search