OnlineCBT Logo OnlineCBT
HTML Tutorial
HTML · LESSON 20

Figure and Figcaption

By Ratan Updated: 16 Oct 2026

Add semantic captions to images, charts, and code snippets using <figure> and <figcaption>.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive

1. Semantic Media Grouping:
&

Before HTML5, web developers used generic

and elements to style image captions. HTML5 introduced the semantic
and
elements to bind illustrations, diagrams, code snippets, or charts with their descriptive caption.

2. Basic Syntax

Normal distribution curve of NEET scores
Figure 1.1: Score distribution across 200,000 participating candidates.

3. Usage with Code Snippets

is not limited to images; it can encapsulate any self-contained reference content such as programmatic algorithms:


function calculatePercentile(rank, totalCandidates) {
    return ((totalCandidates - rank) / totalCandidates) * 100;
}
  
Algorithm 3: Method for computing candidate percentile rank.

4. Accessibility Advantage

Screen readers recognize

as the authoritative label for the figure content, enabling non-sighted users to quickly grasp the significance of visual charts without ambiguity.

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat