如何在我的HTML中找到未使用的类? [英] How to find unused classes in my HTML?
问题描述
有很多工具可用于查找样式表中未使用的CSS规则,例如 Chrome审核和Firefox的 Dust-Me选择器附加组件不兼容Firefox Quantum)。
There are lots of tools for finding unused CSS rules in stylesheets, such as Chrome Audits and the Dust-Me Selectors add-on for Firefox (unfortunately not compatible with Firefox Quantum).
但是反过来呢?
如何找到类在我的HTML中,这是不存在于我的样式表?
How do I find classes that are in my HTML, that do not exist in my stylesheets?
推荐答案
这可能会有所帮助: https://code.google.com/p/find-unused-classes/ 。根据描述:
This may be helpful: https://code.google.com/p/find-unused-classes/ . According to the description:
它显示了存在于css选择器中的类,并且不存在于html页面和like-verse中。
It shows classes that exist in css selectors and do not exist on html page and like-verse.
正如Jim所说,要警告一些类可能未被样式表使用,但仍然用于JavaScript。
As Jim said, be warned that some classes may be unused by your stylesheets but still used in JavaScript.
这篇关于如何在我的HTML中找到未使用的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!