Should I duplicate img default src in source - <picture> tag

Viewed 31

Do I need to duplicate path to default image img/myphoto.jpg in source tag when using picture tag, or I can leave it fallback by itself to that if picture tag is not supported? (less code)

This:

<picture>
  <source srcset="img/myphoto.webp" type="image/webp">
  <source srcset="img/myphoto.jpg" type="image/jpeg"> 
  <img src="img/myphoto.jpg" alt="">
</picture>

or this:

<picture>
  <source srcset="img/myphoto.webp" type="image/webp">
  <img src="img/myphoto.jpg" alt="">
</picture>
0 Answers
Related