What Beautiful HTML Code Looks Like How to write beautiful HTML code. An article written by a foreigner: What Beautiful HTML Code Looks Like How to write beautiful HTML code feels very well written, so I reposted it and shared it with you: ps: Original address: http://css-tricks.com/what-beautiful-html-code-looks-like/ 1. DOCTYPE Properly Declared Don't forget the header declaration, which tells the browser how to render your HTML. 2. Tidy Head Section Set the title and character set. Link the CSS and JS to external links (including a CSS for printing). 3.Body IDed Give the body an ID. The reason mentioned by the author here is to facilitate the selection of containers in multiple pages. For example, by setting different IDs for BODY in page1 and page2, you can set two different effects through #page1 h2 and #page2 h2. I feel that this depends on the situation and the specific architecture. 4.Semantically Clean Menu Write semantic menu code. <div id="menu"> 5.Main DIV for all Page Content There should be a main DIV that contains all the content. It is convenient to fix the width, margins, etc. of the subject. 6. Important Content First Write the main content first, then the secondary content. If your navigation or sidebar is not very important, it is best to write them last. 7. Common Content Included Import common parts such as navigation and footer through dynamic calls, such as PHP include. 8.Code is Tabbed into Sections Indent code 9.Proper Ending Tags Note the closing tag 10.Hierarchy of Header Tags Use heading tags, such as <h1>~<h6>, to divide paragraphs where appropriate. 11. Content, Content, Content Use appropriate labels and sign codes, use & copy; to indicate ©, and do not use </br> 12.No Styling! Don't put styles in tags; HTML is only used to represent structure. Let CSS handle the performance. ![]() |
<<: Quickly get started with VUE 3 teleport components and usage syntax
>>: How to implement dynamic automatic up and down of upstream servers without reload based on nginx
View container logs First, use docker run -it --r...
1. Problem There is a table as shown below, we ne...
Table of contents 1- Error details 2-Single Solut...
1. The value used in the button refers to the text...
I've been researching some things about linke...
Recently, there is a particularly abnormal busine...
Table of contents 1. Overview 2. Digital Enumerat...
Table of contents 1. Detailed syntax of entires()...
What is a tree in web design? Simply put, clicking...
Recently, I have a project that requires using ifr...
Preface After reading the previous article about ...
1. Brief Introduction of Nginx Nginx is a free, o...
Table of contents Overview 1. Parent component pa...
Table of contents What is an event A Simple Examp...
I installed MySQL on Windows by unzipping the com...