Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any tool to detect lines of html/css code that are actually not being used anymore? [closed]

Tags:

html

css

I recently redesigned my website and now I have many lines of code that are not being used anymore when the website loads. Its really tedious to go through all the lines manually, is there any tool for this? Thanks!

like image 526
Nagendra Rao Avatar asked Dec 26 '12 22:12

Nagendra Rao


People also ask

How do I get rid of unused CSS?

If you want to remove unused CSS entirely, you can use a tool such as PurifyCSS to find out how much CSS file size can be reduced. Once you get the CSS code you should eliminate, you have to remove it manually from the page. If you want to deep dive into a manual solution, you can read the CSS-tricks in-depth article.

How do I know if a code is CSS?

Press "Ctrl-F" and type "style." The window searches the code for that word. If you see a style tag in an HTML document, that document uses CSS. The code between the opening <style> tag and the closing </style> tag contains the CSS.


2 Answers

Looks like http://unused-css.com/ will check for unused CSS on your site.

Unused JS will be much tougher.

like image 119
Andy Lester Avatar answered Oct 29 '22 06:10

Andy Lester


Found these for fixing html,

  • http://fixmyhtml.com/
  • http://unfuckmyhtml.com/

and these for fixing css

  • http://unused-css.com/
  • https://github.com/giakki/uncss (I personally recommend this. Great tool!)
like image 21
Nagendra Rao Avatar answered Oct 29 '22 06:10

Nagendra Rao