What is HTML semantics?
HTML tags can be divided into semantic tags and non-semantic tags. For example, table represents a table, form represents a form, a tag represents a hyperlink, and strong label represents emphasis. Typical non-semantic tags include
why? Why semantics?
1. Nowadays, development is basically carried out by a team. In this case, the code we write should not only be understandable by ourselves, but also easy for others to understand and read. It is important to ensure the maintainability of the code. However, in actual development, due to the flexibility of HTML and the power of CSS, the code written by different people may be implemented in different ways to implement the same interface style. If the implementation is poor, it may be all divs within divs. Such code may be a disaster if maintained. This, I personally think, is the most important factor.
2. Establish good communication with search engines to help crawlers capture more effective information
3. Consider the reusability and portability of the code to facilitate other devices parsing execution. Mobile devices, readers for the blind, etc.
Personal feelings
There are not many things you need to learn about HTML and CSS. The threshold for use is relatively low, but it is still difficult to use it well. Using it is pure art. It's like everyone knows Chinese characters, but writers can use these characters to write moving articles, but I can't. . .
For the same page, the HTML written by different people is likely to be different. Personally, I feel that the structure of HTML directly determines the complexity of the CSS selector, image to post-maintenance, and even image performance, etc. In short, it is still difficult to use HML and CSS well.
The above are some of my personal feelings in actual development. Experts are welcome to correct me and communicate.