CSS Inheritance
= Index DOT Css by Brian Wilson =

Main Index | Property Index | CSS Support History | Browser History


Inheritance
If a particular CSS property is not explicitly specified for an element, what rendering properties should the element have? For assigning properties to multiple selectors, it would be redundant, time-consuming and space-consuming having to re-state the same properties for multiple sections and levels of a document. The size of the style sheet information would quickly become unwieldy. Additionally, a style sheet author may not know ahead of time the structure of the document the style sheet will be attached to. CSS avoids this problem by allowing style properties to be inherited between elements.

Every Document Is A Tree
Every document containing markup is a tree of information, where nested elements are nodes that branch from the topmost element (In the case of HTML, the HTML element is the top of this tree.) Elements nested within other elements represent branches, while empty elements and text represent leaves of the tree. CSS allows some properties applied to certain elements to be inherited from those specified for parent elements further up the document tree (toward the root element.) Not all CSS properties are inherited, and those that are may not always be inheritable by all elements. Please refer to the pages for each of the individual CSS properties to find a breakdown of inheritance rules.

The Advantages of Inheritance
Inheritance quickly becomes nothing short of vital for applying style information when you consider the following: Notes

Boring Copyright Stuff....