Collected by Elizabeth Janson Home Page |
|
Rules for handling parsing errorsAll levels of CSS -- level 1, level 2, and any future levels -- use the same core syntax. This allows UAs to parse (though not completely understand) style sheets written in levels of CSS that didn't exist at the time the UAs were created. Designers can use this feature to create style sheets that work with older user agents, while also exercising the possibilities of the latest levels of CSS.
KeywordsKeywords have the form of identifiers. Keywords must not be placed between quotes ("..." or '...'). Thus, in 'color:red', red is a keyword, but if I used "red" I would have an error("red" is a string.) BlocksA block starts with a left curly brace ({) and ends with the matching right curly brace (}). In between there may be any characters, except that parentheses (( )), brackets ([ ]) and braces ({ }) must always occur in matching pairs and may be nested. Single (') and double quotes (") must also occur in matching pairs, and characters between them are parsed as a string
A rule set (also called "rule") consists of a selector followed by a declaration block. Invalid name or value
A user agent must ignore a declaration with an invalid property name or an invalid value. Every CSS2 property has its own syntactic and semantic restrictions on the values it accepts. H1 { color: red; font-style: 12pt } /* Invalid value: 12pt */ P { color: blue; font-vendor: any; /* Invalid prop.: font-vendor */ font-variant: small-caps } H3, H4 & H5 {color: red } /* Invalid "&" is not a valid token */ EM { font-style: normal } The second declaration on the first line has an invalid value '12pt'. The second declaration on the second line contains an undefined property 'font-vendor'. The CSS2 parser will ignore these declarations, effectively reducing the style sheet to: H1 { color: red; } P { color: blue; font-variant: small-caps } EM { font-style: normal } In some cases, user agents must ignore part of an illegal style sheet. This specification defines 'ignore' to mean that the user agent parses the illegal part (in order to find its beginning and end), but otherwise acts as if it had not been there. Safety Net for future changesTo ensure that new properties and new values for existing properties can be added in the future, user agents are required to obey the following rules when they encounter the following scenarios:
|
CSS begins here |
|
This page is part of Elizabeth Janson's web site
http://www.oocities.org/elizatk/index.html
Tetbury residents in the Eighteenth Century my Australian Family History and Barrie, our Family Poet. |