John Allsopp wrote:
Perhaps someone has seen, or has a definitive answer to this question

which has the higher specificity

h1 {}

or

h1, h2 {}

(don't worry about the order in the style sheet, just in an absolute sense)

Specificity is exactly the same. Refer to "5.2.1 Grouping"

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

Example(s):

In this example, we condense three rules with identical declarations into one. Thus,

h1 { font-family: sans-serif }
h2 { font-family: sans-serif }
h3 { font-family: sans-serif }

is equivalent to:

h1, h2, h3 { font-family: sans-serif }
"

http://www.w3.org/TR/CSS21/selector.html#grouping

> "count the number of element names and pseudo-elements in the selector"
>
> I interpret to mean that the group is of specificity 2, and so higher
> than the type selector, of specificity 1
> Or do they both have a specificity of 1?

Grouping is merely a shorthand. h1,h2 does not count as a single selector of specificity 2, but two separate selectors of specificity 1.

--
Patrick H. Lauke
_____________________________________________________
re�dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to