<figure> nhóm nội dung minh họa có thể tách ra mà không ảnh hưởng luồng văn bản chính: ảnh, biểu đồ, code snippet, video. <figcaption> là chú thích mô tả, đặt đầu hoặc cuối <figure>.
Ví dụ: <figure><img src="chart.png" alt="Biểu đồ doanh thu Q1 2024"><figcaption>Biểu đồ doanh thu Q1</figcaption></figure>. <figcaption> bổ sung thêm cho alt, không thay thế nó — alt vẫn cần mô tả nội dung ảnh cho screen readers; figcaption là caption hiển thị cho tất cả users. Nếu figcaption đã mô tả đầy đủ, alt có thể để rỗng (alt=""). Khác với chỉ dùng <img>: figure semantically đóng gói ảnh kèm caption.
<figure> groups illustrative content that can be moved without affecting the main text flow: images, charts, code snippets, videos. <figcaption> provides a caption describing the figure, placed at the top or bottom.
Example: <figure><img src="chart.png" alt="Q1 2024 Revenue Chart"><figcaption>Q1 Revenue Chart</figcaption></figure>. <figcaption> supplements alt — it does not replace it. alt still needs to describe the image for screen readers; figcaption is visible caption for all users. If the figcaption fully describes the image, alt may be empty (alt=""). Compared to <img> alone, figure semantically groups the image with its caption.