Getting an error in W3C Markup Validation when trying to get a whole <Figure> element as a link in a page

醉酒当歌 提交于 2019-12-02 00:06:41

From the spec:

Contexts in which this element can be used: As the first or last child of a figure element.

You are trying to use it as a child element of an <a> not a <figure>

Better to do this:

   <a href="#">
     <figure>
        <img src="images/product-image.jpg" alt="image  " />
        <span class="label"><span class="rotate">40%</span></span>
        <span class="curle-label_bg"></span>
        <figcaption><span class="product-brand">Brand of product</span>
          Main Caption here 
         <span class="save-money">Save 395.05</span>
         <span class="product-price">€169.30</span>
       </figcaption>
     </figure>
   </a>

Now the figure is enclosed within the a tag, and the figcaption is a child of the figure, not the <a>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!