Errors on picture element when running W3C validator

Created on 23 May 2017, over 7 years ago
Updated 19 September 2023, over 1 year ago

When running my site through W3C validator I get the following errors:

  • Element img is missing required attribute src.
  • When the srcset attribute has any image candidate string with a width descriptor, the sizes attribute must also be present.

This is how my picture element looks like:

<picture  class="img-responsive">
  <!--[if IE 9]><video style="display: none;"><![endif]-->
  <source srcset="http:://www.mysite.com/logo.png?itok=YkGooEhb&amp;timestamp=1456780233 1x, http:://www.mysite.com/logo-2.png?itok=_g8tW0b0&amp;timestamp=1456780233 2x" media="(min-width: 0px)" />
  <!--[if IE 9]></video><![endif]-->
  <!--[if lt IE 9]>
  <img  class="img-responsive" src="http:://www.mysite.com/logo-3.png?itok=YkGooEhb&amp;timestamp=1456780233" alt="" title="" />
  <![endif]-->
  <!--[if !lt IE 9]><!-->
  <img  class="img-responsive" srcset="http:://www.mysite.com/logo-4.png?itok=YkGooEhb&amp;timestamp=1456780233 400w" alt="" title="" />
  <!-- <![endif]-->
</picture>
πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States albertski

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom lesleyfernandes

    I am closing all very old tickets that have not received comments for a long time. If someone still faces these issues or thinks they are still relevant, please reopen it. Feel free to contribute with more info or a patch.

Production build 0.71.5 2024