检测未使用的CSS规则 [英] Detect unused CSS rules
问题描述
我正在开发一个网站。
我使用现成的template.this模板包含许多带有许多css规则的css文件。
但是我有几个页面,我确信我没有使用所有选择器。
是否有任何工具可以扫描项目HTML文件并找到未使用的CSS规则并删除它们?
我找到此问题说:
Dust-me Selectors 是一个可以找到未使用的选择器的firefox插件。
但它不兼容FF6,
您可以使用chrome的开发人员工具获得一个大致的想法。 p>
- 在Chrome中打开页面
- 打开开发者工具(Ctrl + Shift + I)
- 打开审核标签
- 点击运行
- 展开删除未使用的CSS规则项目以查看样式列表
- Open the page in Chrome
- Open developer tools (Ctrl+Shift+I)
- Open the Audits tab
- click run
- expand the "Remove unused CSS rules" item to view a list of style sheets that contain unused style rules.
这不会列出哦等待... ... XD
Possible Duplicate:
How can I find unused images and CSS styles in a website?
I am developing a website.
I use ready template.this template contains many css files with many css rules.
But I have few pages and I am sure I didn't use all selectors.
Is there any tool exist for scanning project HTML files and finding unused css rules and remove them ?
I found this question that says :
Dust-me Selectors is a firefox plugin that finds unused selectors.
But its not compatible with FF6 and seems it just review current viewing page and not scans whole website files.
You can get a general idea with chrome's developer tools.
This doesn't list them out oh wait... it does... XD
这篇关于检测未使用的CSS规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!