清理 CSS 的工具?
在发布网站之前,我有大量未使用的 CSS 样式。 有没有什么好的工具可以检测未使用的 CSS 类、div?
相关问题:
Before publishing a site I have bloat of unused CSS styles. Is there any good tool to detect unused CSS classes, divs?
Related Questions:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一个简单的基于 Web 的 css 优化器,非常有用:
http://www.cleancss.com/
Here is a simple web based css optimizer, very useful:
http://www.cleancss.com/
尝试 ProCSSor
Try ProCSSor
确保您有 firebug(对于 Firefox,如果您不知道),然后安装由 Google 开发的 firebug 的 pagespeed 插件:
http://code.google.com/speed/page-speed/
它会在 firebug 中为您提供一个“pageSpeed”选项卡。 打开它,选择“性能”,单击“分析性能”。 除了许多其他有用的建议之外,您还将获得一个标记为“删除未使用的 CSS”的列表项。 单击将其展开,然后查看当前页面上显示的未使用 css 规则的资源细分,以及通过删除未使用的规则将节省的内存大小。
Make sure you have firebug (for Firefox, if you don't know), and then install the pagespeed plugin for firebug, developed by Google:
http://code.google.com/speed/page-speed/
It will give you a 'pageSpeed' tab in firebug. Open it and, with 'performance' selected, click 'analyze performance'. Along with lots of other useful suggestions, you will get a list item labelled "Remove Unused Css". Click to expand it and see a breakdown by resource of unused css rules appearing on the present page, along with the memory size that you will save by removing the unused rules.
您可以尝试 CSS Tidy:
http://csstidy.sourceforge.net/
它简单而有效。
You can try CSS Tidy:
http://csstidy.sourceforge.net/
It is simple yet effective.