Image in picture element has width bigger than the asset's width

Viewed 60

How to prevent img in a picture element to get bigger that that actual asset's dimensions? Similar as when loading an img element width height and width set to auto?

<img src="https://dummyimage.com/160x90/000/fff" />

<!-- vs. -->

<picture>
  <source media="(min-width: 1px)" srcset="https://dummyimage.com/160x90/000/fff 160w" />
  <img />
</picture>

https://jsfiddle.net/1zbdewpc/

1 Answers

The 160w messes up the code:

First Image:

First Image:

Second Image:

Second Image:

Related