简体   繁体   English

如何从“多个”html 文件中删除未使用的 CSS,这些文件都链接到“单个”CSS 文件?

[英]How to remove unused CSS from "multiple" html files all linked to a "single" CSS file?

I have build a website where multiple html pages are linked to a single CSS file.我已经建立了一个网站,其中多个 html 页面链接到单个 CSS 文件。

Now I would like to remove all unused css from this single file.现在我想从这个单个文件中删除所有未使用的 css。

Is there any way or tool to do it?有什么方法或工具可以做到吗?

Here is my file structure:这是我的文件结构:

index.html 
about.html
contacts.html

They all have the same他们都有相同的

style.css

How to remove unused css from the style.css without braking everything?如何在不制动一切的情况下从 style.css 中移除未使用的 css?

You can store 'shared' styles to one file (for example global.css) linked to all pages you have, and for each page use stylesheet with CSS you use on that specific page (for example about.css on about.html page). You can store 'shared' styles to one file (for example global.css) linked to all pages you have, and for each page use stylesheet with CSS you use on that specific page (for example about.css on about.html page) .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM