CSS2 Test Suite: 5.8.1 Attribute Selectors

[index page] [section] [Previous] [Next] [Specification]

The style declarations contained within this page:

P[class] {color: purple;}
P[class="one"] {color: green;}
P[class = "one"] {text-decoration: underline;}
P[class~="two"] {color: olive;}
P[class ~= "two"] {text-decoration: overline;}
P[class|="three"] {color: green;}
P[class |= "three"] {text-decoration: underline;}
P[class|="give"] {color: green;}
P[class~="give"][class~="generously"] {color: red;}
P[lang|="en"] {color: green;}
P[lang |= "de"] {color: green;}
A[HREF] {color: purple;}
A[HREF="http://www.erehwon.zzz/"] {color: green;}
A[NAME="hello"] {color: green;}
P[class="null"] {color: yellow; background: red; font-weight: bold;}
     /*  catch broken forward-compatible parsing */</STYLE>


This is a paragraph, and should not be green.

This is a paragraph with a class of 'test', and should be purple.

This is a paragraph with a class of 'one', and should be green and underlined.

This is a paragraph with a class of 'one step forward', and should NOT be green (but purple instead), nor should it be underlined.

This is a paragraph with a class of 'two steps back', and should be olive and overlined.

This is a paragraph with a class of 'one two three', and should be olive and overlined.

This is a paragraph with a class of 'world war two', and should be olive and overlined.

This is a paragraph with a class of 'three-blind-mice', and should be green and underlined.

This is a paragraph with a class of 'bakers-three', and should NOT be green (but purple instead), nor should it be underlined.

This is a paragraph with a class of 'give me liberty', and should be green. If it is red, then it has inappropriately matched a rule which contains the classes 'give' and 'generously'; if it is black, it has not matched any attribute selector rules. If it is purple, it has matched the attribute selector [class] but not any of the value-related selectors.

This is a paragraph with a LANG of 'en', and should be green.

This is a paragraph with a LANG of 'en-au', and should be green, mate.

This is a paragraph with a LANG of 'de-test', and should be green, ja?

The following hyperlinks should have the color indicated for each:

The text between the dashes-- you know, this stuff here-- should be green, as it is contained by an anchor with a NAME of "hello".


[index page] [section] [Previous] [Next] [Specification]