The most time-saving CSS naming convention in my opinion

CSS naming convention one

  The naming of variables in js is best to use camel case, but CSS is more suitable for red-box naming conventions.

CSS naming convention 2 BEM naming convention

  B=>block E=>element M=>modifier

  1. Subcomponents of components are named stick-man__head with two underscores

  2. The modification of the component is named stick-man--red with two short lines

  3. Name js-stick-man at the beginning of js- for js code

  4. Use attribute name with attribute name [rel='js-stick-man']

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325382422&siteId=291194637