Previous Message
Next Message

how to specify mutiple selectors for a:link etc

Sent by Ingo Chao on 14 March 2006 19:07


Don - htmlfixit.com wrote:
> I want it to be this:
> .header1 a:link
> .header2 a:link
> 
> Do I need to repeat the a:link part?
> 
> .header1 a:link, .header2 a:link {color: #881719; text-decoration: none;}

It is mentioned in http://www.w3.org/TR/CSS21/selector.html#q2
5.2 Selector syntax / 5.2.1 Grouping


"A selector is a chain of one or more simple selectors separated by 
combinators."
The whitespace between these two selectors is a "Combinator", which 
combines the two selectors into one:

..header1 a:link

"When several selectors share the same declarations, they may be grouped 
into a comma-separated list."

..header1 a:link, .header2 a:link { property: value; }

The comma separates two combined selectors.

Ingo

-- 
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: