A Guide to HTML Image Captions

Discover how to properly use HTML image captions with <figure> and <figcaption> to improve your site's SEO, user experience, and web accessibility.

A Guide to HTML Image Captions
Related Posts
blog_related_media
blog_topic
blog_related_activities
blog_niche
blog_related_tips
unique_blog_element
Images are everywhere on the web, but without context, they can feel like digital noise. A well-crafted HTML image caption is what turns a simple picture into a powerful piece of communication, bridging the gap between what a user sees and what they understand.
The best, most modern way to do this is by using the semantic <figure> and <figcaption> elements. This approach is not only accessible but also great for SEO.

Why Good HTML Image Captions Matter

notion image
Think about it from your reader's perspective. Captions guide them through your content, provide necessary attribution for a photo, or explain complex details that the image itself can't fully express. A data chart, for example, is just a jumble of lines and bars without a caption to explain the story behind the numbers.
This isn't just about aesthetics; it's a fundamental piece of a strong user experience.

Captions and Web Accessibility

HTML image captions are absolutely critical for web accessibility. For visitors who rely on screen readers, visual information is out of reach. While alt text is there to describe the image for those who can't see it, the caption provides supplementary context that's available to everyone.
When you use <figure> and <figcaption>, screen readers announce their relationship, creating a complete and accessible experience. You simply don't get that crucial semantic link by tossing a generic <p> tag under an image. If you skip this, you're potentially leaving a big chunk of your audience with an incomplete picture of your content.
Here's the key difference: a caption provides additional context for all users, while alt text provides an equivalent experience for users who can't see the image. Using both correctly is a cornerstone of inclusive web design.

Boosting Your SEO with Captions

Search engines like Google are always getting smarter about understanding the content on a page. Using <figure> and <figcaption> gives them a crystal-clear, structured signal that a piece of text is directly tied to a specific image.
This has some real, tangible benefits for your site's visibility:
  • Better Image Search Rankings: Google actually indexes the text in your captions and uses it as a strong ranking signal for image search. A descriptive caption can be the difference-maker that gets your visuals showing up for relevant queries.
  • Stronger Topical Relevance: The keywords inside your captions reinforce the overall topic of the page for search crawlers, strengthening their semantic understanding of your content.
  • Improved User Engagement: Clear, helpful captions keep people on your page longer. That increased dwell time is a positive signal to search engines that can indirectly give your rankings a nice little boost.
Properly structured image captions are a non-negotiable part of high-quality web design, contributing to both the look and the performance of your site. If you're looking to level up your site's overall design and functionality, exploring professional web design services can provide expert guidance. And for a deeper dive into getting your images noticed, check out how to optimize images for SEO in our detailed guide.

Using Figure and Figcaption for Semantic HTML

If you're still wrapping an image and a <p> tag in a <div> for your captions, it's time for an upgrade. That's the old way of doing things. The modern, and frankly, the correct way is to use the <figure> and <figcaption> elements. These HTML5 tags were literally designed to solve this exact problem: semantically linking a caption to its image.
Think of the <figure> tag as a dedicated container for self-contained content. Most of the time, that's an image, but it could just as easily be a chart, a diagram, or even a code snippet. Inside that container, you have your <img> tag for the visual element and the <figcaption> for the descriptive text.
This structure does something a <div> never could: it tells browsers and assistive tech, "Hey, this text belongs to this image." It creates a rock-solid programmatic link between the two.

The Basic Structure

Let's look at how this works in practice. The code is clean, simple, and far more meaningful than a generic container.
Here’s the basic blueprint:
This simple block of code is the foundation. It’s a tiny change that makes a huge difference in how machines and screen readers interpret your content.
This screenshot from MDN Web Docs shows how a browser renders this simple but effective code.
As you can see, the browser naturally places the caption right below the image. It establishes a clear visual relationship right out of the box, before you even touch your CSS.
The relationship between <figure> and <figcaption> isn't just about tidy code. It carries serious semantic weight that directly boosts both accessibility and SEO.
When a screen reader encounters a <figure> element, it knows to announce the image and its caption together. This creates a cohesive, understandable experience for users with visual impairments.
It's strange how we treat different types of media. We've made huge strides with video accessibility—one study found that 80% of Gen Z viewers use subtitles 'most of the time'—but image accessibility often gets left behind. The WebAIM Million report revealed that a staggering 18.5% of images on home pages had missing alt text. That's a massive gap. You can dig more into these media consumption habits from Kapwing.
By using <figure> and <figcaption>, you are actively closing this accessibility gap. You're not just putting text near an image; you're forging a meaningful connection that ensures everyone gets the full context.

Handling Multiple Images with One Caption

What about a gallery of related images that all share a single description? The <figure> element handles this scenario with elegance. Just place multiple <img> tags inside a single <figure> and use one <figcaption> to describe the whole group.
This is perfect for situations like:
  • A step-by-step process with several screenshots.
  • Showing off a product from multiple angles.
  • A collection of photos from the same event.
Here's how you'd structure it:
This approach keeps your code clean and tells search engines and screen readers that these images function as a single, cohesive unit. It’s a smart way to provide group context without cluttering your page with repetitive captions.

Alt Text vs. Image Captions: What's the Difference?

One of the most common hangups I see with HTML images is the confusion between alt text and captions. They seem similar on the surface, but they do two completely different jobs. Nailing this distinction is your first step toward creating content that’s both accessible and SEO-friendly.
Think of it this way: alt text is a functional replacement for an image. It’s written for people who can't actually see the image—whether they're using a screen reader or stuck on a slow connection where images won't load. A good alt attribute describes what the image is and what it does.
A <figcaption>, however, is supplementary information for everyone. It adds context, credit, or extra detail that you wouldn't get just from looking at the image.

Deciding Which One to Use

So, when do you use alt text, a caption, or both? It all comes down to the image's role on the page. If it's purely for decoration, it probably doesn't need either (though it should still have an empty alt="" attribute to be ignored by screen readers). For any meaningful image, the choice depends on the story you’re trying to tell.
This little decision tree can help you visualize when a caption is the right move.
notion image
The main takeaway here is that if your image is a self-contained unit of content that needs a bit more explanation, wrapping it in <figure> with a <figcaption> is the semantically correct way to go.
Getting this wrong isn't just a minor mistake; it has a real impact. The WebAIM accessibility analysis of the top one million home pages is pretty eye-opening. They found an average of 58.6 images per page, but a shocking 18.5% were missing alt text entirely. That makes them completely invisible to screen readers.

Real-World Examples

Let's look at how this plays out in a couple of common scenarios.
  • Scenario 1: A Team Photo
    • Image: A picture of your company's marketing team at a retreat.
    • Alt Text: alt="The Feather marketing team smiling for a photo at the 2023 company retreat in the mountains." This is a straight-up description for anyone who can't see the image.
    • Figcaption: <figcaption>Our marketing team, led by Jane Doe (center), during our annual strategy summit.</figcaption> This adds extra context for all users, like identifying a key person.
  • Scenario 2: A Data Chart
    • Image: A bar chart showing website traffic growth over the past year.
    • Alt Text: alt="Bar chart showing monthly website traffic increasing from 10,000 visitors in January to 50,000 in December." This communicates the essential data from the chart.
    • Figcaption: <figcaption>Figure 1.1 - Website traffic saw a 5x increase in 2023, driven by our new content strategy.</figcaption> This gives the chart a label and explains the meaning behind the data.
Notice how in both examples, the alt text and figcaption aren't just repeating each other. The alt text says what the image is, while the caption explains its significance or provides extra info.
To make things even clearer, I've put together a quick reference table to help you decide on the fly.

Alt Text vs Figcaption: When to Use Which

Attribute
Primary Purpose
Target Audience
Best Practice Example
alt Text
Describes the image's content and function. Acts as a replacement.
Screen reader users, search engines, and users with images disabled.
"A golden retriever catching a red frisbee in a sunny park."
<figcaption>
Provides extra context, credit, or a title for the image.
All users who can see the image and its surrounding content.
"Photo by Maria Rodriguez. A rare sighting of the monarch butterfly migration."
Getting the hang of this difference is a small tweak with a huge payoff. You'll make your visual content more inclusive for all users and give search engines the clear signals they need to understand your page.

How to Style Image Captions with Modern CSS

notion image
Getting your HTML markup right is a huge first step, but a semantically correct caption isn't doing its job until it looks good and works perfectly on every device. This is where CSS comes in—it's the bridge between functional markup and a polished, professional design.
The good news? You're in complete control. You can tweak everything from font size and color to alignment and spacing, making sure your captions blend right in with your site's overall aesthetic. Let’s walk through a few practical techniques to get your captions looking sharp.

Fundamental Caption Styling

First things first, let's nail the basics. The most common styling tweaks are often the most effective. You'll typically want to target the <figcaption> element directly to control its look and feel. A good starting point is to make the font just a bit smaller and less prominent than your main body text.
Most designers focus on a few key areas:
  • Font Styling: Adjusting the size, weight, and style (like making it italic) helps create a clear visual distinction between the caption and the article content.
  • Color and Opacity: Using a slightly lighter text color, like a dark gray instead of pure black, can make the caption feel subordinate to the main text, which is usually what you want.
  • Text Alignment: Centering the caption is a popular choice. It often looks clean and intentional, especially when the image above it is also centered.
For example, this quick CSS snippet handles all three, giving you a classic, understated caption style.
figcaption { font-size: 0.9rem; /* Slightly smaller than body text / color: #555; / A dark gray instead of pure black / text-align: center; margin-top: 8px; / Adds a little space below the image */ font-style: italic; }

Creating Responsive Captions

Styling for a big desktop screen is one thing, but making sure those captions don't fall apart on a phone is critical. A caption that looks perfect on your monitor can quickly become a squished, awkwardly-wrapped mess on a smaller screen. This is where responsive design principles are non-negotiable.
The main goal here is to keep everything readable without breaking the layout. Visuals are a massive part of modern content—one Venngage survey found that 52.22% of marketers rely heavily on charts and data visualizations. Yet, we often drop the ball on accessibility; over 30% of homepage images have useless or missing alt text. Making your captions responsive is another piece of that puzzle.
A key technique is to make sure the parent <figure> element never gets wider than its container. This is what stops your images from spilling out of the layout on narrow screens.
figure { margin: 20px 0; /* Adds vertical space around the figure */ max-width: 100%; }
figure img { max-width: 100%; height: auto; /* Maintains aspect ratio */ display: block; } This simple CSS makes the image fluid, allowing it to scale down gracefully as the screen size shrinks. And since the <figcaption> lives inside the <figure>, it will naturally wrap and align correctly right under the resized image. For a deeper dive, check out some real-world examples of responsive web design.
Pro Tip: Keep an eye on the default browser margins for the <figure> element. I almost always reset this (margin: 0;) or set it explicitly to match my site's spacing grid. It’s a small detail that makes a big difference for consistent alignment.

Going Deeper with Advanced Captioning

Once you've got the hang of the basics with <figure> and <figcaption>, it's time to dig into the trickier situations and the common mistakes that can trip you up. Getting the semantic markup right is a huge win, but real-world projects often demand a few extra tools to nail accessibility and dodge layout headaches.

When a Simple Caption Isn't Enough

One of the most common challenges I see is when an image's description needs to be far more detailed than what a simple <figcaption> can handle. Think of a complex chart or a dense infographic. In these moments, you can lean on ARIA attributes to give accessibility a serious boost.
The aria-describedby attribute is your friend here. It lets you programmatically link an image to a more thorough description that lives somewhere else on the page.
For example, you might have a chart with a visible caption, but a full paragraph explaining its data sits just below. By using aria-describedby, you create an invisible-but-crucial connection that screen readers can pick up on, ensuring users with visual impairments get the complete picture.
Here's a common misconception: aria-describedby does not replace <figcaption>. They work together. The <figcaption> is the visible, concise caption for everyone, while aria-describedby adds a deeper, screen-reader-specific layer of detail when you really need it.

Sidestepping Common Layout Traps

Even with flawless HTML, CSS can still throw a wrench in the works. Two particular issues pop up constantly, especially in responsive designs, that can absolutely tank the user experience.
  • Image Overflow: On smaller screens, a big, fixed-width image can easily bust out of its container, triggering those ugly horizontal scrollbars. We touched on the fix earlier, but it's worth hammering home: max-width: 100%; on your <img> tag is non-negotiable. It's a lifesaver.
  • Layout Shift: This is a big one. If you don't declare an image's dimensions, the browser often has to reshuffle the page layout once the image finally loads. This makes content jump around, which is incredibly jarring for users and puts a dent in your Core Web Vitals score. Always, always include width and height attributes on your <img> tags to prevent this.

How Content Management Systems Handle Captions for You

Manually writing <figure> and <figcaption> for every single image is fine if you're coding a site from scratch, but what about when you’re using a CMS?
The good news is that modern platforms like WordPress, Ghost, and our own platform here at Feather are smart enough to handle this automatically.
When you add a caption to an image through a modern editor, the system does the heavy lifting for you, wrapping it all in the correct <figure> and <figcaption> structure on the front end. This is a massive time-saver and ensures you're following best practices without ever having to peek at the code. For instance, when you caption an image in Notion and publish with Feather, we generate the proper HTML for you behind the scenes.
This automation is huge for maintaining consistency and accessibility across your site. It also feeds into generating structured data, which helps search engines understand your content on a deeper level. You can see how this works by checking out our guide on adding schema markup to your site. This background work ensures your HTML image captions aren't just visible, but are technically sound.

Got Questions About HTML Image Captions? We've Got Answers.

When you're digging into the nitty-gritty of HTML, a few common questions about image captions always seem to pop up. Getting the right answers is key to making sure your images are both accessible and playing nice with search engines.

Do Image Captions Actually Help SEO?

Yes, they absolutely do. Think of it this way: search engines like Google are constantly trying to figure out what your content is about, and the text inside a <figcaption> is a powerful clue.
Well-written, relevant captions help your images show up in image searches and beef up the overall topical authority of your page. That little snippet of text provides extra keywords and context that crawlers use to connect your visuals to what people are actually searching for.

Can't I Just Use a Div and a P Tag?

Visually, you could style a <p> tag inside a <div> to look just like a caption, but you'd be missing the point from a technical standpoint. It's all about semantics.
Using <figure> and <figcaption> together creates a direct, programmatic link between the image and its description. This relationship is crystal clear to screen readers and search engine crawlers, which is exactly why it's the modern HTML5 standard.

So, Does Every Single Image Need a Caption?

Not at all. Captions are there to add extra context or information that isn't immediately obvious just by looking at the picture. They’re perfect for things like charts, complex diagrams, or photos that need a credit line.
But for purely decorative images? A caption would just be clutter.
A good rule of thumb is to ask yourself: does this text add real value or necessary clarification? If the answer is no, skip it. Just remember, while not every image needs a caption, nearly every non-decorative image must have descriptive alt text for accessibility.
Ready to stop wrestling with code and just focus on creating? With Feather, your Notion content is automatically converted into a fully optimized, SEO-friendly blog—with proper HTML image captions built right in. Start publishing in minutes at https://feather.so.

Ready to start your own blog while writing all your content on Notion?

Notion to Blog in minutes

Start your free trial