I would avoid using the picture element in 2019. It's mostly a remanent from the first responsive images implementation. img now also has access to easier srcset and sizes attributes and has a smaller footprint. See ericportis.com/posts/2014/srcset-s... , especially part 2.
Yeah, came here to say the same thing – img srcset is supported everywhere, already gives you correct fallback "for free" (since you still declare a src attribute for that purpose), and provides all of the CSS query selector stuff in a much more compact, easily-parsed and easily-generated format. For example, the article's code would be captured as <img src="img_kitten.jpg" alt="Kitten" srcset="img_cat_fat.jpg 650w, img_cat_fluffy.jpg 465w">
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would avoid using the
pictureelement in 2019. It's mostly a remanent from the first responsive images implementation.imgnow also has access to easiersrcsetandsizesattributes and has a smaller footprint. See ericportis.com/posts/2014/srcset-s... , especially part 2.Yeah, came here to say the same thing –
img srcsetis supported everywhere, already gives you correct fallback "for free" (since you still declare asrcattribute for that purpose), and provides all of the CSS query selector stuff in a much more compact, easily-parsed and easily-generated format. For example, the article's code would be captured as<img src="img_kitten.jpg" alt="Kitten" srcset="img_cat_fat.jpg 650w, img_cat_fluffy.jpg 465w">