
This example uses our founder portrait. The caption adds a readable name and role.
Decide what the caption adds
A project photo might need a short explanation of the work shown. A product image might need a label identifying the selected variation. A team portrait may need a name and role. Write the information someone needs to interpret that particular image, rather than repeating the page heading underneath every picture.
Start with a verified fact. If you do not know the material, date, location, person’s role, or product configuration, check with the content owner before adding it. Do not turn a photograph into evidence for a result it cannot establish. Keep important service conditions and purchasing information in the main page content where readers can find them without studying a photo.
Group the image and caption in HTML
For a self-contained image and its explanation, place both inside a figure and put the caption in a figcaption. Here is the markup used for the portrait above:
<figure class="caption-example">
<img src="/assets/img/founder/colby-swecker-224.webp"
alt="" width="112" height="112" decoding="async">
<figcaption>
Colby Swecker, founder of Colby Technologies.
</figcaption>
</figure>Use your own approved image and wording when adapting the example. Keep the caption as the first or last child of its figure. MDN explains the figure element and figcaption element. A figure can contain content other than a photograph, but a caption belongs with the item it actually describes.
Do not add a second, unrelated caption somewhere else on the page and rely on its visual position to imply the relationship. Keep the pair together in the source. If the picture is purely decorative and has nothing useful to explain, an additional caption may not help the reader.
Review alt text separately
A visible caption and an image alternative have different jobs. A caption supplies context to everyone reading the page. The alternative should account for what the image contributes when the image itself is unavailable. Avoid automatically copying the caption into the alt attribute, and avoid automatically deleting the alternative whenever you add a caption.
In the portrait example, the surrounding text and caption already identify Colby and explain the purpose of the picture. The image does not add another essential instruction or detail for this demonstration, so its alternative is empty. A detailed project image may need an alternative describing something the caption does not explain. Decide from the image’s role on that specific page.
If the image is also a link, review its accessible link label and destination. An empty alternative in an otherwise empty link can leave the action unclear. The business image alt-text guide covers that separate decision.
Keep the caption readable on small screens
Use ordinary text below the picture rather than embedding the caption into the image file. That makes wording easier to revise and lets it wrap with the page. Keep the text large enough to read, with sufficient contrast against the real background.
.project-figure {
margin: 1rem 0;
max-width: 100%;
}
.project-figure img {
display: block;
max-width: 100%;
height: auto;
}
.project-figure figcaption {
margin-top: 0.5rem;
line-height: 1.5;
}This sample expects a figure with the project-figure class. Adapt it to the existing layout instead of applying new rules to every image on the site. Keep the image’s width and height attributes in proportion to the file, and check nearby grid or container rules if either part is clipped. Do not force a wide project photograph into a square merely because the portrait example is square.
Place credits and links with care
If a credit is needed for an approved image, use the wording and destination the content owner has confirmed. A credit line does not establish permission to use a file. Do not publish private client details or identify people from a photograph without the business’s appropriate approval.
Use a descriptive link where the caption genuinely needs a supporting destination. For example, a project caption can link to the relevant public project explanation. Keep long promotional claims, repeated service keywords, and unrelated calls to action out of the caption. Put the inquiry action beside the service information instead.
Publish the pair and maintain it together
Find the maintained HTML or content-generator source before editing. Review the image path, caption, alternative, any credit link, and the page’s next action. Test on a narrow phone layout and desktop, including at larger text sizes. Confirm that the caption still describes the actual file and does not appear beneath a different image after the layout changes.
Run the repository’s required checks and publish through the existing workflow. Open the exact live URL and verify both the image and its text. A correct local caption does not prove production received it. The image and video speed checklist covers media delivery questions beyond the caption itself.
Record who approves the wording and revisit it whenever the image is replaced. A new photograph may show a different variation, stage of work, or person, even when the filename stays the same. For the broader DIY publishing workflow, explore the BUILD • PUBLISH • OWN IT guide.
Need help updating website photos and captions?
Send the public page URL, the approved image and caption, and any context that must remain visible. We can review the scope with you. For recurring content updates, review website management.
Request website help