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

Viewed 44

I have build a website where multiple html pages are linked to a single CSS file.

Now I would like to remove all unused css from this single file.

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?

1 Answers

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).

Related