Code formatting: Code is better, easier to understand, and better to maintain.
Code style One:
The main features include the following:
- The top line of the selector is written.
- Display and indent 4 spaces per declaration line
- The rules can be properly empty between lines to facilitate reading
- The proposed empty space between the property and the property value, and the selector list, makes the code look less crowded.
Code style Two:
The main features include the following:
- The top line of the selector is written.
- The style code line is displayed, and all declarations are placed in one line.
- The rules can be properly empty between lines for reading.
- The best space between the property and the property value, the declaration, and the selector list is easy to read.
Code style Three:
The main features include the following:
- The top line of the selector is written.
- When the code within the style is less, or if the number of bars declared is only one or two bars, the code can be displayed side by side in a row, following the style of the second code style.
- When the code within the style is relatively long, or the number of bars declared exceeds 3, the declaration can be displayed in multiple lines, following the first code style style
- The best space between the property and the property value, the declaration, and the selector list is easy to read. The style can be properly empty between lines.
The code format can be optimized and set using the development tools.
Three common code styles for CSS