Beyond headings, paragraphs and lists, HTML has a set of small elements that each describe one specific kind of content. They take seconds to learn, they make pages clearer for every reader, and they give browsers, search engines and assistive technology information that plain <div> and <span> elements can't.
In this lesson you'll learn <figure> and <figcaption> for images, charts and code with a caption, <time> for machine-readable dates and times, <mark> for highlighted text such as search matches, and two bar elements that are easy to confuse: <progress> for how far through a task you are, and <meter> for a measurement within a known range.
Each of these works without any CSS or JavaScript, and each can be styled to match your design. Used well, they turn ordinary pages into pages that communicate exactly what they mean.
figure and figcaption
<figure>
<img src="chart.png" alt="Bar chart of monthly sales, rising from 120 in January to 310 in June">
<figcaption>Figure 1: Sales doubled in the first half of the year.</figcaption>
</figure><figure>wraps self-contained content that's referred to from the main text: images, diagrams, charts, code listings, quotes or videos.<figcaption>is the visible caption, placed first or last inside the figure.- The caption doesn't replace the image's
alttext:altdescribes the image; the caption adds context.
time and mark
<time datetime="2026-03-14">14 March 2026</time>: the visible text can be written any way you like, whiledatetimeholds a standard, machine-readable value.- Formats include a date (
2026-03-14), a time (19:30), both (2026-03-14T19:30), with a time zone (2026-03-14T19:30Z), or a duration (PT2H30Mfor 2 hours 30 minutes). - Search engines, calendars and browser extensions can read
datetime, which helps with events and article dates. <mark>highlights text that's relevant in the current context, such as the words someone searched for. Browsers show it with a yellow background by default.
progress and meter
| Element | Shows | Example |
|---|---|---|
<progress value="70" max="100"> | Completion of a task | Upload 70% done |
<progress> with no value | A task with unknown length | Loading spinner style bar |
<meter value="0.8"> | A measurement in a range | Disk 80% full |
<meter low high optimum> | Changes colour by zone | Battery low or good |
Always put a text version between the tags or in a label, such as 70%, for older browsers and screen readers.
HTML Figure and Time Syntax
Element syntax
<figure>
<img src="photo.jpg" alt="Description">
<figcaption>Caption text</figcaption>
</figure>
<p>Published <time datetime="2026-03-14">14 March</time></p>
<p>Results for <mark>lamp</mark></p>
<progress value="40" max="100">40%</progress>
<meter value="7" min="0" max="10">7 out of 10</meter>HTML Figure and Time Summary
<figure>with<figcaption>groups media or code with a visible caption.<time datetime="...">gives dates and times a machine-readable value.<mark>highlights relevant text, such as search matches.<progress>shows task completion; withoutvalueit shows an indeterminate bar.<meter>shows a measurement in a known range, with optional low, high and optimum zones.
HTML Figure and Time Examples
Each example runs in the page. Edit the code and press Run to see what changes.
A captioned photo and code listing
<figure>
<img src="https://picsum.photos/seed/lake/320/180" alt="A calm lake surrounded by pine trees" width="320" height="180">
<figcaption>Lake Bled at sunrise, our favourite stop on the trip.</figcaption>
</figure>
<figure>
<figcaption>Listing 1: a greeting function</figcaption>
<pre><code>function greet(name) {
return "Hi " + name;
}</code></pre>
</figure>Line-by-line explanation
- Lines 1 to 4The figure groups the photo with its caption.
- Line 2
altdescribes the image; the caption adds information around it. - Line 6A caption can also come first, before a code listing.
Dates in an article and search highlights
<article>
<h2>Spring opening hours</h2>
<p>Posted on <time datetime="2026-03-14">Saturday 14 March</time>.</p>
<p>From <time datetime="2026-03-21">21 March</time> we open at <time datetime="08:30">8:30am</time>.</p>
<p>The workshop lasts <time datetime="PT1H30M">an hour and a half</time>.</p>
</article>
<p>Search results for "desk": the <mark>desk</mark> lamp, the standing <mark>desk</mark>.</p>Line-by-line explanation
- Line 3Friendly visible text, precise
datetimevalue. - Line 4
datetimecan hold just a time. - Line 5Durations start with P; T separates the time part.
- Line 7
<mark>highlights the searched word.
Progress and meter bars
<p><label for="up">Uploading photos:</label>
<progress id="up" value="65" max="100">65%</progress> 65%</p>
<p>Loading messages: <progress aria-label="Loading">Loading</progress></p>
<p><label for="disk">Storage used:</label>
<meter id="disk" value="0.92" min="0" max="1" low="0.5" high="0.85" optimum="0.2">92%</meter> 92%</p>
<p><label for="score">Your score:</label>
<meter id="score" value="8" min="0" max="10" low="4" high="7" optimum="10">8 out of 10</meter></p>Line-by-line explanation
- Line 2A determinate progress bar, 65 out of 100.
- Line 4With no
value, the bar shows activity without a known end. - Line 7Storage above the
highmark, far from theoptimum, so browsers show it in a warning colour. - Line 10Here high values are good, because the optimum is the maximum.
Common HTML Figure and Time Mistakes
Using progress for a measurement
<progress value="80" max="100">Disk 80% full</progress><meter value="80" max="100">Disk 80% full</meter>A full disk isn't a task in progress; it's a measurement.
A time element with an invalid datetime
<time datetime="14/03/2026">14 March</time><time datetime="2026-03-14">14 March</time>datetime must use the standard year-month-day format.
Using mark just for decoration
<p><mark>Welcome to our website!</mark></p><p class="intro">Welcome to our website!</p><mark> means "relevant here"; for a design highlight, use CSS.
HTML Figure and Time in Real Projects
Where these appear
News and blog articles mark up publish dates with <time>, and search engines use them in results. Documentation uses <figure> for diagrams and code listings. Upload forms and installers show <progress>, password strength indicators and storage dashboards use <meter>, and site search pages highlight matches with <mark>.
HTML Figure and Time Exercises
Answer each one and check it instantly. If you get stuck, open the hint before the answer.
Complete the caption element inside the figure.
<figure>
<img src="map.png" alt="Map of the route">
<>Our walking route</>
</figure>
<figcaption> holds a figure's caption.Which element highlights search matches?
<mark> a yellow background.Which datetime value is valid for 5 June 2026?
Which element suits a phone battery level?
Fix the markup: the caption should be a figcaption inside the figure, and the date needs a valid datetime of 2026-09-01.
<figure>
<img src="team.jpg" alt="Our team at the summer party" width="200" height="120">
</figure>
<p class="caption">The team in summer.</p>
<p>Updated <time datetime="1 Sept">1 September</time></p>- The caption is a figcaption inside the figure
- The time has a valid datetime
HTML Figure and Time Quiz
5 questions to check what you learned.
What does figure usually contain?
- Only text paragraphs
- Self-contained content such as an image, chart or code listing, often with a caption
- Navigation links
- Form fields
What does a progress element with no value attribute show?
- An indeterminate bar for a task of unknown length
- An empty bar
- A full bar
- Nothing
What does the datetime attribute provide?
- The visible text
- A countdown
- A time zone converter
- A machine-readable version of the date or time
Does figcaption replace an image's alt text?
- No, alt describes the image while the caption adds context
- Yes
- Only for charts
- Only on mobile
What do the low, high and optimum attributes of meter control?
- The bar's size
- Animation speed
- Which ranges count as good or bad, which changes the colour browsers use
- Accessibility labels
HTML Figure and Time Challenge
An article footer
Build:
- A
<figure>with an<img>(with alt) and a<figcaption> - A paragraph with a
<time>whosedatetimeis2026-04-02 - A
<progress>withvalue="3"andmax="5"showing reading progress
- Figure with an image and caption
- time datetime is 2026-04-02
- progress is 3 of 5
<progress> both value and max.