css responsive image

56

<picture>
  <source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg">
  <source media="(min-width: 800px)" srcset="elva-800w.jpg">
  <img src="elva-800w.jpg" alt="Chris standing up holding his daughter Elva">
</picture>
img,
video,
iframe {
  max-inline-size: 100%;
  block-size: auto;
}

Comments

Submit
0 Comments