0

For first, I'm really sorry for my English.

My question: Let's say you code a few HTML pages with one CSS file. Now, not every HTML page uses everything out of the CSS file. How can I see what a specified page is using out of the CSS in the easiest way?

The purpose: I have a CSS file with more than 4500 lines. Instead to search the whole HTML for the CSS classes etc. and remove them, I'd like to see everything that this page is using - So, everything in CSS, what is not needed, to delete.

TheCodingBook
  • 21
  • 1
  • 7
  • Possible duplicate of [is-there-a-way-to-check-which-css-styles-are-being-used-or-not-used-on-a-web-pag](http://stackoverflow.com/questions/4361007/is-there-a-way-to-check-which-css-styles-are-being-used-or-not-used-on-a-web-pag) – user2314737 Oct 02 '15 at 10:20
  • Well, you could work out which pages use which styles and link to different sheets, but it sounds like a nightmare. CSS is read and styles added to the HTML pretty quickly - so a 4500 line file doesn't sound that bad (unless, is this minified?!). There are more important steps you can take to improve performance, e.g. reduce HTTP requests, parallel downloads, etc. – Paul Redmond Oct 02 '15 at 10:22
  • If you want to check step by step you should inspect element and see what css files is your page using: http://prntscr.com/8muk4j Also, you can take a look on this thread: http://addyosmani.com/blog/removing-unused-css/ – Dejan Munjiza Oct 02 '15 at 10:24
  • The problem is not the performance. It's because I included the HTML in another page, so the other page is using the 4500-lines CSS also which modifies a lot of things. – TheCodingBook Oct 02 '15 at 10:25
  • Dejan Munjiza, Thank you. Simply I can remove the unused CSS first and then to search everything one-by-one :) – TheCodingBook Oct 02 '15 at 10:26

0 Answers0