the following is an excerpt from the Cascading Style Sheets, level 2 revision 1 CSS 2.1 Specification which appears in the Panelizer, a convenient package of resources, available FREE in a .zip archive, and downloadable via Rijkโs handy link (Rijk is a well known, and credible People.Opera.com user and author).This is not the complete text from the original resource, or from Rijkโs Panelizer, but merely a sample snippet which iโve cut to jar my memory of the original text. Follow the URL here, in the previous sentence for the complete, original document.
6.4.2 !important rules: an excerpt
Declaring a shorthand property (e.g., โbackgroundโ) to be โ!importantโ is equivalent to declaring all of its sub-properties to be โ!importantโ.The first rule in the userโs style sheet in the following example contains an โ!importantโ declaration, which overrides the corresponding declaration in the authorโs style sheet. The second declaration will also win due to being marked โ!importantโ. However, the third rule in the userโs style sheet is not โ!importantโ and will therefore lose to the second rule in the authorโs style sheet (which happens to set style on a shorthand property). Also, the third author rule will lose to the second author rule since the second rule is โ!importantโ. This shows that โ!importantโ declarations have a function also within author style sheets./* From the userโs style sheet */
p { text-indent: 1em ! important }
p { font-style: italic ! important }
p { font-size: 18pt }/* From the authorโs style sheet */
p { text-indent: 1.5em !important }
p { font: normal 12pt sans-serif !important }
p { font-size: 24pt }
6.4.4 Precedence of non-CSS presentational hints: an excerpt
The following user stylesheet would override the font weight of โbโ elements in all documents, and the color of โfontโ elements with color attributes in XML documents. It would not affect the color of any โfontโ elements with color attributes in HTML documents:b { font-weight: normal; }
font[color] { color: orange; }The following, however, would override the color of font elements in all documents:font[color] { color: orange ! important; }
http://people.opera.com/rijk/panels/panelizer.html
(or http://people.opera.com/rijk/panels/ )
Rijk van Geijtenbeek. ยฉ Rijk 2005
(note: Rijkโs current: http://www.xs4all.nl/~vangeijt/ )
VI: Assigning property values, Cascading, and Inheritance
Cascading Style Sheets, level 2 revision 1
CSS 2.1 Specification
W3C Working Draft 13 June 2005
Copyright ยฉ 2005 W3C ยฎ (MIT, ERCIM, Keio), All Rights Reserved.