Skip to content

语义 HTML

一句话解释

语义 HTML uses 标签那个 convey meaning and purpose 的内容, 而不是只是它的 appearance.

用大白话说

语义 HTML 平均值 using HTML 标签那个描述什么内容 IS, 不只是如何它 looks. 相反的 using <div> for 一切, 你 use <header>, <nav>, <main>, <article>, <section>, <footer>, and other tags that communicate the role of each part of the page.

Semantic HTML benefits accessibility (screen readers use it to navigate), SEO (search engines understand the page structure better), and developer communication (the code is self-documenting). It also enables browser features like reader mode.

The rule is simple: if a tag exists that describes your content's purpose, use it. Only fall back to <div> or <span> when no semantic tag fits.

示例

html
<article>
  <header>
    <h1>Blog Post Title</h1>
    <time>2026-01-15</time>
  </header>
  <p>Content here...</p>
  <footer>
    <p>Written by Ada</p>
  </footer>
</article>

语义标签描述结构: article, 请求头, 时间, and footer 所有 convey meaning.

相关术语

相关资源

相关课程

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表