Home  >  Article  >  Web Front-end  >  Introduction to css optimization strategies

Introduction to css optimization strategies

王林
王林forward
2020-07-09 17:24:132277browse

Introduction to css optimization strategies

Methods to optimize css and improve performance:

(Recommended tutorial: css Quick Start)

  • Avoid over-constraints

  • Avoid descendant selectors

  • Avoid chain selectors

  • Use compact syntax

  • Avoid unnecessary namespaces

  • Avoid unnecessary duplication

  • It is best to use semantic names. A good class name should describe what it is, not something like

  • Avoid! important, you can choose other selectors

  • to streamline the rules as much as possible. You can merge repeated rules in different categories

The above is the detailed content of Introduction to css optimization strategies. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete