Closed macjabeth closed 3 years ago
Instead of coding the image URL as a background, it should use an picture tag with source tags set to appropriate poster sizes so that the image quality is optimized for each device.
picture
source
Example:
<picture> <source media="(max-width: 92px)" srcset="w92.jpg"> <source media="(max-width: 154px)" srcset="w154.jpg"> <source media="(max-width: 185px)" srcset="w185.jpg"> <source media="(max-width: 342px)" srcset="w342.jpg"> <source media="(max-width: 500px)" srcset="w500.jpg"> <source media="(max-width: 780px)" srcset="w780.jpg"> <img src="original.jpg" alt="Poster image"> </picture>
The available poster sizes can be viewed here. Documentation on responsive images can be found here.
Ok
Instead of coding the image URL as a background, it should use an
picture
tag withsource
tags set to appropriate poster sizes so that the image quality is optimized for each device.Example:
The available poster sizes can be viewed here. Documentation on responsive images can be found here.