Firefox 插件查找未使用的 CSS 样式
可能的重复:
识别未使用的 CSS 定义的工具
假设我的浏览器中显示了一个页面我在这个页面上使用了一个 .CSS 文件,其规则如下:
.class1{
/* some style definitions */
}
.class2{
/* some style definitions */
}
.class3{
/* some style definitions */
}
....
...
.class1001{
/* some style definitions */
}
现在我的问题是,是否有任何插件可以告诉我这些规则,这些规则在页面上“未使用”。
我看到了一些相关的问题,其中提供了插件链接告诉 CSS 选择器在页面上使用。但是我有大约 1000 多个规则,因此想直接知道未使用的规则。
只是要添加,提到的插件有 1 个问题; 就像如果有针对 IE 的 hack(例如 *html),它会将它们标记为 UNUSED,即使它实际上在 IE 中使用。有什么解决方法吗?
请帮我。谢谢。
Possible Duplicate:
Tool to identify unused css definitions
Lets say I have a page displayed in my browser and I have a .CSS file used on this page with rules like
.class1{
/* some style definitions */
}
.class2{
/* some style definitions */
}
.class3{
/* some style definitions */
}
....
...
.class1001{
/* some style definitions */
}
Now my question is is there any addon which would tell me like out of these rules, which are "NOT USED" on the page..
I saw some related questions which provide links to addon that tell CSS selectors which are used on a page..But I have like 1000+ rules and hence want to directly know RULES which are NOT used..
JUST TO ADD, the addons mentioned have 1 issue;
Like if there are hacks for IE (e.g. *html), it marks them as UNUSED, even though it is actually used in IE. Is there any workaround for this ?
Please help me. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Firefox,则可以使用 Dust Me Selectors 插件来完全满足您的要求。它会为您找到未使用的选择器:) 尝试一下!
还有 CSS 使用插件,它可以查看您的CSS 文件并告诉您哪些未被使用。 :)
If you use Firefox, you can use the Dust Me Selectors plugin that does exactly what you asked for. It finds unused Selectors for you :) Give it a try!
Also there is the CSS Usage plugin, that looks over your CSS file and tells you which ones are not being used. :)