Figure/figcaption: strange message

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
mjucker
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 3
Joined: Tue Jul 09, 2019 7:30 am

Figure/figcaption: strange message

Post by mjucker » Tue Nov 26, 2019 6:18 am

HTML-Validator 19.03.03 (Pro) – with WeBuilder 2020
figcaption.jpg
figcaption.jpg (89.93 KiB) Viewed 45 times
I get a warning about a missing optional figcaption - but as the attached screenshot shows that a figcaption exists.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3453
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Figure/figcaption: strange message

Post by Albert Wiersch » Tue Nov 26, 2019 9:30 am

Hello,

The complete message is:
The "figure" element does not contain an optional "figcaption" element. The "figcaption" element can be used as the first or last child of a "figure" element to provide a caption or legend. This message is displayed up to 3 times.

Please move the "figcaption" element to the first or last child of the "figure" element (or only child). Example:

Code: Select all

<figure>
 <img src="image.jpg" alt="" height="120" width="180">
 <figcaption>
  <a href="URL">link text</a>
 </figcaption>
</figure>
I will add an error when "figcaption" is not used as a direct child of "figure" in the next major release.

I hope this helps. Please let me know if you have any more questions.
Image
Albert Wiersch

Post Reply