Home  >  Q&A  >  body text

Way to find all unused classes and IDs in HTML

<p>I have many classes and IDs in my long HTML that don't have CSS code associated with them, and it would be tedious to look up each one to see if they are related. </p> <p>I want to remove all unnecessary classes and IDs. Is there an easy way to do this? </p>
P粉919464207P粉919464207385 days ago434

reply all(1)I'll reply

  • P粉898107874

    P粉8981078742023-09-02 11:20:56

    Chrome Developer Tools There is an audit tab that shows unused CSS selectors.

    The bad thing though, if I remember correctly, is that you need to run it on every page.

    reply
    0
  • Cancelreply