Jon Galloway Jon Galloway - 14 days ago 7
CSS Question

How can I find unused images and CSS styles in a website?

Is there a tool or methodology (other than trial and error) I can use to find unused image files? How about CSS declarations for ID's and Classes that don't even exist in the site?

It seems like there might be a way to just spider the site, profile it, and see which images and styles are never loaded.

Answer

There's a Firefox extension that finds unused CSS selectors on a page. It has an option to spider the whole site. Version 3.01 should work with newer versions of Firefox.

https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/

And here's another option.

https://addons.mozilla.org/en-US/firefox/addon/css-usage/

Comments