search

Home  >  Q&A  >  body text

html - 如何删除css文件中没有被引用的类?

我的css文件太大了,有许多没有被使用的类,如何才能把它们找出来给删除?有什么工具吗?

黄舟黄舟2778 days ago479

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-17 11:40:06

    In the Developer Tools of the chrome browser, there is an audit option.
    Click the run button, and you can find a Remove unused CSS rules< in the results. 🎜>, click on it and you will see a lot of current useless css rules.

    Note that

    useless here is relative. Many rules may only take effect after certain elements are clicked or an event is triggered, so manual screening is still required.

    reply
    0
  • Cancelreply