Figure/figcaption: strange message

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
Rank 0 - Newcomer
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 (89.93 KiB) Viewed 957 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: 3573
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Figure/figcaption: strange message

Post by Albert Wiersch »


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

 <img src="image.jpg" alt="" height="120" width="180">
  <a href="URL">link text</a>
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.
Post Reply