Figure/figcaption: strange message

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

Figure/figcaption: strange message

Post by mjucker »

HTML-Validator 19.03.03 (Pro) – with WeBuilder 2020
figcaption.jpg
figcaption.jpg (89.93 KiB) Viewed 2746 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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Figure/figcaption: strange message

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply