CSS @media rules
Opened this issue · 0 comments
birneee commented
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
like https://github.com/ericf/css-mediaquery
in css e.g.:
@media only screen and (max-width: 734px) and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (max-width: 734px) and (min-resolution: 1.5dppx),
only screen and (max-width: 734px) and (min-resolution: 144dpi)
in html e.g.:
<picture>
<source type="image/svg+xml" srcset="pyramid.svg" />
<source type="image/webp" srcset="pyramid.webp" />
<img
src="pyramid.png"
alt="regular pyramid built from four equilateral triangles" />
</picture>
<img
srcset="elva-fairy-480w.jpg 480w, elva-fairy-800w.jpg 800w"
sizes="(max-width: 600px) 480px,
800px"
src="elva-fairy-800w.jpg"
alt="Elva dressed as a fairy" />