开发者

Detect unused CSS rules [duplicate]

This question already has answers here: How to identify unused CSS definitions from multiple CSS files in a project (3 answers) Closed 1 year ago.

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.

  1. Open the page in Chrome
  2. Open developer tools (Ctrl+Shift+I)
  3. Open the Audits tab
  4. click run
  5. expand the "Remove unused CSS rules" item to view a list of style sheets that contain unused style rules.

This doesn't list them out oh wait... it does... XD

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜