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

specificity of style rule?

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Thu, 1 Dec 2005 11:03:16 -0800
Message-ID: <c9e12660512011103n6f8542dfl16f9e5e7f16d6764@mail.gmail.com>
To: www-dom@w3.org

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>

--
http://dhtmlkitchen.com/
Received on Thursday, 1 December 2005 19:03:29 GMT

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