- According to the HTML5 specification, the type attribute generally does not need to be specified when importing CSS and JavaScript files, because text/css and text/javascript are their default values respectively
- Boolean properties can be declared without assignment. The XHTML specification requires it to be assigned a value, but the HTML5 specification does not
- For property values or color parameters, omit leading 0s for decimals less than 1 (for example, .5 instead of 0.5; -.5px instead of -0.5px)
- Hexadecimal values should be all lowercase, for example, #fff. Lowercase characters are easier to distinguish when scanning documents because their form is easier to distinguish
- Try to use shorthand hexadecimal values, e.g. #fff instead of #ffffff
- Avoid specifying units for 0 values, for example, use margin: 0; instead of margin: 0px;
- Related property declarations should be grouped together in the following order: Positioning | Box model | Typographic | Visua
- Compared with the <link> tag, the @import directive is much slower, not only adding extra requests, but also causing unforeseen problems
- Only lowercase characters and dashes can appear in class names
Coding Standards
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325216295&siteId=291194637
Recommended
Ranking