Tool for cleaning up CSS?

送分小仙女□ 提交于 2019-12-23 23:24:00

问题


Before publishing a site I have bloat of unused CSS styles. Is there any good tool to detect unused CSS classes, divs?

Related Questions:

  • Tool to identify unused css definitions
  • Are there any utilites that will help me refactor CSS

回答1:


You can try CSS Tidy:

http://csstidy.sourceforge.net/

It is simple yet effective.




回答2:


Use this firefox plugin to find which of your css styles are not being utilized. http://blog.brothersmorrison.com/?p=198

or get it from Mozilla https://addons.mozilla.org/en-US/firefox/addon/css-roundup/




回答3:


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




回答4:


Try ProCSSor




回答5:


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.



来源:https://stackoverflow.com/questions/672786/tool-for-cleaning-up-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!