W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2005

Re: specificity of style rule?

From: Ray Whitmer <ray@personallegal.net>
Date: Fri, 2 Dec 2005 09:26:47 -0700
Message-Id: <947596FE-47EE-4F4E-9109-F76D130AD3DF@personallegal.net>
Cc: www-dom@w3.org
To: Garrett Smith <dhtmlkitchen@gmail.com>


On Dec 1, 2005, at 12:03 PM, Garrett Smith wrote:

>
> Hi Everyone,
>
> I'm brand new to the list.
>
> I wonder: is there a way to know the specificity of a cssRule? Can I
> get some number representing the weight?
> Example:
>
> <style>
> #foo {
>
> }
>
> p {
>
> }
> </style>
> <script>
> var cssRules = document.styleSheets[0].cssRules;
>
>
> if(cssRules[0].weight > cssRules[1].weight) {
>
> }
> <script>

I do not know the answer.  If this is not answered here, you might  
try one of the lists mentioned on:

http://www.w3.org/Style/CSS/learning

because maintenance of the CSS DOM specification was adopted by that  
group, I believe.

Ray Whitmer
Received on Friday, 2 December 2005 16:28:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT