These attributes allow preloading the appropriate resource that is later used by an img element that has the corresponding values for its srcset and sizes attributes:
Note how we omit the href attribute, as it would only be relevant for browsers that do not support imagesrcset, and in those cases it would likely cause the incorrect image to be preloaded.
The last sentence indicates that no `href` belongs on this LINK element. However, when I attempt to validate it with the validator, it issues this error:
The "link" element requires the "href" attribute to specify the link. This is an HTML5 requirement.
Unless the spec quoted above has been revised, it looks like the validator shouldn't count this type of LINK without an `href` as erroneous HTML.
Thanks! I can confirm it works for my site code. And it identified a few images that were misnamed in the imagesrcset listing that I wouldn't have caught otherwise (it reported a 404 when trying to retrieve them...fantastic!)
TomHTML wrote: ↑Sun Oct 10, 2021 3:59 pm
Thanks! I can confirm it works for my site code. And it identified a few images that were misnamed in the imagesrcset listing that I wouldn't have caught otherwise (it reported a 404 when trying to retrieve them...fantastic!)