<section class="container">
  <picture>
    <source media="(min-width: 1024px)" srcset="https://picsum.photos/1280/500">
    <source media="(min-width: 700px)" srcset="https://picsum.photos/700/360">
    

    <img src="https://picsum.photos/500/360" alt="Random Images">
  </picture>
</section>
body {
  margin: 0 auto;
  font-family: sans-serif;
}

img {
  max-width: 100%;
  height: auto;

  vertical-align: middle;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.