31.03.2014 Views

Cascading Style Sheets, Level 2 - World Wide Web Consortium

Cascading Style Sheets, Level 2 - World Wide Web Consortium

Cascading Style Sheets, Level 2 - World Wide Web Consortium

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The second declaration on the first line has an invalid value ’12pt’. The second<br />

declaration on the second line contains an undefined property ’font-vendor’. The<br />

CSS2 parser will ignore [p. 42] these declarations, effectively reducing the style<br />

sheet to:<br />

H1 { color: red; }<br />

P { color: blue; font-variant: small-caps }<br />

EM EM { font-style: normal }<br />

4.1.9 Comments<br />

Comments begin with the characters "/*" and end with the characters "*/". They<br />

may occur anywhere between tokens, and their contents have no influence on<br />

the rendering. Comments may not be nested.<br />

CSS also allows the SGML comment delimiters ("") in certain<br />

places, but they do not delimit CSS comments. They are permitted so that style<br />

rules appearing in an HTML source document (in the STYLE element) may be<br />

hidden from pre-HTML 3.2 user agents. See the HTML 4.0 specification<br />

([HTML40]) for more information.<br />

4.2 Rules for handling parsing errors<br />

In some cases, user agents must ignore part of an illegal style sheet. This specification<br />

defines ignore to mean that the user agent parses the illegal part (in<br />

order to find its beginning and end), but otherwise acts as if it had not been there.<br />

To ensure that new properties and new values for existing properties can be<br />

added in the future, user agents are required to obey the following rules when<br />

they encounter the following scenarios:<br />

Unknown properties. User agents must ignore [p. 42] a declaration [p. 41]<br />

with an unknown property. For example, if the style sheet is:<br />

H1 { color: red; rotation: 70minutes }<br />

the user agent will treat this as if the style sheet had been<br />

H1 { color: red }<br />

Illegal values. User agents must ignore a declaration with an illegal value.<br />

For example:<br />

IMG { float: left } /* correct CSS2 */<br />

IMG { float: left here } /* "here" is not a value of ’float’ */<br />

IMG { background: "red" } /* keywords cannot be quoted in CSS2 */<br />

IMG { border-width: 3 } /* a unit must be specified for length values */<br />

A CSS2 parser would honor the first rule and ignore [p. 42] the rest, as if the<br />

style sheet had been:<br />

IMG { float: left }<br />

IMG { }<br />

IMG { }<br />

IMG { }<br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!