There are many things that need to be paid attention to in the WEB standard CSS web page layout. We have made many introductions, and today we introduce five points that need attention.
1. Always use lowercase letters
Example Source Code: Bad practice: <DIV> <P>Here's an interesting fact about corn. </P> </DIV> Good practice: <div> <p>Here's an interesting fact about corn. </p> </div> |
2. Let quotes accompany attributes
Example Source Code: Bad practice: class=bookchinazcom Correct approach: class="bookchinazcom" |
3. Necessary code comments
"Making your code easy to understand and maintain over a long period of time."
As a developer, it is necessary to comment your code.
Annotated code can help us read and maintain clear thinking and ideas.
It will also facilitate quick modification and debugging in the future. Not only is it convenient for yourself, but it is also convenient for others.
4. Never use straight lines
Maybe you have questions, why not advocate the use of straight lines? This is a very useful label.
But don’t forget that Web standards have always emphasized the separation of performance and content.
Straight lines are part of the performance, and it is obviously inappropriate to write them in HTML documents. Therefore never use straight lines.
5. Never use inline styles
Style sheet files are separated into external style sheet files, separate from the HTML document. Using inline styles loses the meaning of CSS web page layout. However, inline styles can be used during debugging. When the website is finally published, all inline styles need to be removed.