I would like to create a standard way to provide an image with an alt tag for accessibility and SEO, a descriptive caption, and a separate element for a photographer credit. It appears that only one <figcaption>
is allowed per <figure>
and it must be the first or last element, so that rules out doing this:
<figure>
<img src="https://placedog.net/500/280" alt="a handsome pooch stares at the camera">
<figcaption class="caption">George, the doggo</figcaption>
<figcaption class="photo-credit">Photo: Jane Doe</figcaption>
</figure>
Which of these is best, and why?
1
<figure>
<img src="https://placedog.net/500/280" alt="a handsome pooch stares at the camera">
<div class="photo-credit">Photo: Jane Doe</div>
<figcaption class="caption">George, the doggo</figcaption>
</figure>
2
<figure>
<img src="https://placedog.net/500/280" alt="a handsome pooch stares at the camera">
<figcaption>
<span class="caption">George, the doggo</span>
<span class="photo-credit">Photo: Jane Doe</span>
</figcaption>
</figure>
3
Something else...