<figure>
<figcaption><code>sizes="320px"</code></figcaption>
<img srcset="https://placehold.it/320 320w" sizes="320px">
</figure>
<hr>
<figure>
<figcaption><code>sizes="100px"</code></figcaption>
<img srcset="https://placehold.it/320 320w" sizes="100px">
</figure>
<hr>
<figure>
<figcaption><code>sizes="20vw"</code></figcaption>
<img srcset="https://placehold.it/320 320w" sizes="20vw">
</figure>
<hr>
<figure>
<figcaption>No <code>sizes</code> attribute (browsers will assume <code>sizes="100vw"</code>)</figcaption>
<img srcset="https://placehold.it/320 320w">
</figure>
figure {
margin: 0 auto;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.