Find all CSS rules that apply to an element

后端 未结 9 908
温柔的废话
温柔的废话 2020-11-22 10:26

Many tools/APIs provide ways of selecting elements of specific classes or IDs. There\'s also possible to inspect the raw stylesheets loaded by the browser.

However,

9条回答
  •  悲&欢浪女
    2020-11-22 11:07

    Have a look at this library, which does what was asked for: http://www.brothercake.com/site/resources/scripts/cssutilities/

    It works in all modern browsers right back to IE6, can give you rule and property collections like Firebug (in fact it's more accurate than Firebug), and can also calculate the relative or absolute specificity of any rule. The only caveat is that, although it understands static media types, it doesn't understand media-queries.

提交回复
热议问题