Semantic


Semantic

HTML without CSS is a semantic system rather than a UI system.

Normally, each tag has semantics. The so-called semantics means that your clothes are divided into jackets, pants, skirts, underwear, etc., each with corresponding functions and meanings. So you can't put underwear around your neck. -- A hint of

In addition, the semantic HTML structure helps machines (search engines) understand. On the other hand, when multiple people collaborate, they can quickly understand the developer's intentions.

Common tag semantics

QQ截图20170206111258.png

Example

Treat the page you build as a book, and match the semantics of the tags to its functions and meaning;

  • The name of the book: <h1>
  • The title of each chapter of the book: <h2>
  • Article title within the chapter: <h3>
  • Subtitle/subtitle: <h4> <h5> <h6>
  • Paragraphs of chapters: <p>

For more semantic content, refer to the article written by sofish to write your HTML this way.