CSS2 Test Suite: 5.7 Adjacent Sibling Selectors

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

The style declarations contained within this page:

H3 + H4 {color: green;}
UL+P {border-top: 3px solid green;}  /* lack of whitespace shouldn't matter */
EM + STRONG {color: green;}
H3.opener + P {border-top: 3px solid green;}

Here's an H3 element

This H4 should be green


Here's another H3 element

this text is not in an element, and so shouldn't affect the adjacency selector; thus:

This H4 should be green


Here's another H3 element

This text is contained within a paragraph element, and so should affect the adjacency selector; thus:

This H4 should NOT be green


This paragraph, since it follows a UL element, should have a three-pixel green top border.

Within this paragraph, there is emphasized text which contains strongly emphasized text which should NOT be green, as well as strongly emphasized text which should be green.


This is an H3 with a class of "opener".

This paragraph should have a three-pixel solid green top border.

This paragraph should have no border.


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