Date: Thu, 08 Jan 2009 16:31:13 -0500
From: Brett
Subject: [css-d] question about combining descendant selectors
To: css-d@lists.css-discuss.org
Message-ID: <496670a1.9060...@zoominternet.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I'm wondering if combined selec
Brett wrote:
> I'm wondering if combined selectors have a lower specificity than
> non-combined. For example in my stylesheet I have:
>
> .hm #events_snip .date, .article { color: red; }
> .hm #news_snip .date, .article { color: green; }
>
> On the page the .article class shows up green, even t
Your selectors are wrong. You aren't using descendent selectors
for .article. You are saying .hm #news_snip .date has the color green
AND ALSO .article has the color green, because of the comma. That
means you have two declarations for .article, and the second one is
over-riding the first.
I'm wondering if combined selectors have a lower specificity than
non-combined. For example in my stylesheet I have:
.hm #events_snip .date, .article { color: red; }
.hm #news_snip .date, .article { color: green; }
On the page the .article class shows up green, even though it is NOT
descendant