Validation W3C
See original GitHub issueExpected Behavior
Running validator https://validator.w3.org on basic <picture>
elements as per setup config should not result in errors.
Current Behavior
Currently when running validator on:
<picture class="lozad" style="display: block; min-height: 1rem" data-iesrc="images/thumbs/04.jpg" data-alt="">
<source srcset="images/thumbs/04.jpg" media="(min-width: 1280px)">
<source srcset="images/thumbs/05.jpg" media="(min-width: 980px)">
<source srcset="images/thumbs/06.jpg" media="(min-width: 320px)">
<!-- NO img element -->
<!-- instead of img element, there will be the last source with the minimum dimensions -->
<!-- for disabled JS you can set <noscript><img src="images/thumbs/04.jpg" alt=""></noscript> -->
</picture>
Validator will give error:
Element img is missing required attribute src.
Possible Solution
Setting up <nosript>
tag with <img src=(...)>
results in
Element noscript not allowed as child of element picture in this context.
When adding <img src=(...)>
tag without <noscript>
surrounding it, html parser will simply output 2 images…
Steps to Reproduce (for bugs)
Run validator on any website with lozad setup
Context
Trying to get a clean sheet from validator.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
The W3C Markup Validation Service
This validator checks the markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc. If you wish to validate specific content such...
Read more >W3C Validation: What is it and why to use it? - LoginRadius Blog
W3C validation is the process of checking a website's code to determine if it follows the formatting standards. If you fail to validate...
Read more >W3C Validator: What It Is & Why It Matters For SEO
The W3C validator ensures cross-platform compatibility and accessibility through correct coding best practices. Learn how to use it here.
Read more >W3.CSS Validation - W3Schools
The W3C CSS Validation Service can be used to check the correctness (validity) of W3.CSS. The Validation Service was created by the W3C...
Read more >W3C Markup Validation Service - Wikipedia
The Markup Validation Service is a validator by the World Wide Web Consortium (W3C) that allows Internet users to check pre-HTML5 HTML and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hah, just fixed with:
Should be built in though, if you can do the same with
data-srcset
+1