← 中文资源

简体中文版本

Figure Figcaption 语义图注

用 figure 和 figcaption 元素为图片添加语义化图注说明。

阅读英文原文

实现说明

标记使用语义化元素 figure、figcaption 而非通用容器,辅助技术与搜索引擎无需额外约定就能读到真实结构。

常见问题

为什么用语义化元素而不是 div?

<figure>、<figcaption> 把文档结构直接暴露给辅助技术和搜索引擎,无需 ARIA 或类名约定。

核心语句

<figcaption>

代码示例

<figure>
  <img
    src="architecture-diagram.svg"
    alt="System architecture showing three tiers: presentation, application, and data"
    width="800"
    height="400"
  />
  <figcaption>
    Figure 1: Three tier system architecture. The presentation tier
    handles HTTP requests, the application tier contains business logic,
    and the data tier manages persistence.
  </figcaption>
</figure>