I have a CSS file that has grown over time. Many of the coders have come and gone. The site has changed along the way and some of the code in the CSS is no longer being used. Is there a QUICK way to validate what is being used and what is not? I need to remove the OLD code that is no longer being used. Even if there was a "site map" method - that would prove to be even better. All suggestions please.
Note: Validation is important. It will ensure that your web pages are interpreted in the same way (the way you want it) by the various web browsers, search engines etc. as well as users and visitors of your Web site.
A CSS validator checks your Cascading Style Sheet in the same manner. That is, it will check that it complies with the CSS standards set by the W3 Consortium. There are a few which will also tell you which CSS features are supported by which browsers (since not all browsers are equal in their CSS implementation).
A quick way to find errors in CSS code is to install the Web Developer tool bar add-on and use the validator through the tools drop down. What's cool about this tool is you can quickly validate local files too as it will automatically upload them to the W3C validator.
If you use Firefox, you can use the Dust Me Selectors plugin that does exactly what you asked for. It finds unused Selectors for you :) Give it a try!
Also there is the CSS Usage plugin, that looks over your CSS file and tells you which ones are not being used. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With