清理 CSS 的工具?

发布于 2024-07-16 10:20:48 字数 422 浏览 5 评论 0原文

在发布网站之前,我有大量未使用的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

記憶穿過時間隧道 2024-07-23 10:20:48

这是一个简单的基于 Web 的 css 优化器,非常有用:
http://www.cleancss.com/

Here is a simple web based css optimizer, very useful:
http://www.cleancss.com/

银河中√捞星星 2024-07-23 10:20:48

确保您有 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.

陌路黄昏 2024-07-23 10:20:48

您可以尝试 CSS Tidy:

http://csstidy.sourceforge.net/

它简单而有效。

You can try CSS Tidy:

http://csstidy.sourceforge.net/

It is simple yet effective.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文