2003-08-11
CSS3 Attribute Selectors
Problem:
Selecting the h4 contained in the first item of the first of two dynamical lists within a div. Each list is preceded by an h3 with a unique id.
Title
Subhead to select
Subsubheadline
Teaser TextSubhead not to select
Subsubheadline
Teaser Text
Title
Subhead not to select
Subsubheadline
Teaser Text
Solution:
div#test h3[id="a"] + ul li:first-child h4 {
font-family: Georgia, serif;
text-transform: uppercase;
letter-spacing: 0.2em;
}
Note:
Works in Mozilla, Camino, Netscape… Does not work in IE.