What tool can analyze my site and report on unused / unneeded CSS?

后端 未结 6 1675
滥情空心
滥情空心 2021-01-12 13:36

how can i find in a early way that this css class is being used or not in website ?

like-

style property that i write in my css is being used or not?

相关标签:
6条回答
  • 2021-01-12 14:14

    Dust-Me https://addons.mozilla.org/en-US/firefox/addon/5392/

    0 讨论(0)
  • 2021-01-12 14:15

    There's also "Dust-Me", a firefox extension to find unused CSS:

    https://addons.mozilla.org/en-US/firefox/addon/5392/

    However this plugin doesn't work with FF5+

    0 讨论(0)
  • 2021-01-12 14:15

    So you want to be able to do something like click a CSS class and have it find all pages on your site that use that class? Not aware of any such tool, kekekela's answer of CSS Usage is probably about as close as you'll get--which will let you find what CSS an individual page uses.

    0 讨论(0)
  • 2021-01-12 14:25

    The CSS Usage addon for firefox does what I think you are looking for: https://addons.mozilla.org/en-US/firefox/addon/10704/

    0 讨论(0)
  • 2021-01-12 14:29

    While this is rather old a question, TopStyle 5 kicks out reports about Class Usage, Orphan classes, Undefined Classes, ID Overview and Case Mismatch for whole sites, all linked to the respective file or spot in the stylesheet. However, AFAIK only stylesheets are analyzed, not style blocks or inline styles, but that may depend on the layout of the site. For the sites here style blocks are inserted dynamically, so that may be the reason TopStyle misses them. Of course it's not free.

    0 讨论(0)
  • 2021-01-12 14:31

    If you want to see what CSS styles are being applied to an element that is being rendered on your browser you should look into using Firefox and Firebug to view the DOM and CSS information.

    http://getfirebug.com/

    If you are using IE8 you could use the IE8 Developer tools to do the same thing.

    0 讨论(0)
提交回复
热议问题