Emphasis as Child Element Error

I ran my code through the W3C Validator and it keeps showing me the error that emphasis cannot be a child element of any of the following: strong, figcaption or figure.

<img src = "#">
<emphasis><figcaption id = "img-caption"><strong>Queen of Curves</strong></figcaption></emphasis>


But why is it not possible? Should I use instead?

First, <emphasis> is no valid HTML tag, I think you mean <em> instead?

Second, the <figcaption> element needs to be a direct child of the <figure> element. I you want to wrap the figcaption in <em> tags, put them directly around the text (like you did with the <strong> tags).

1 Like

Ah yes! I’ve been substituting <em> as emphasis in my mind and wrote that down as well. Thanks for the reply, I understand.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.