How to Show Different Images Depending on Browser Width using Html only?
The html <picture>
element allows you to define different images for different browser window sizes.
it is simple just see below code and paste it on your html.
<picture> <source srcset="img_smallflower.jpg" media="(max-width: 600px)"> <source srcset="img_flowers.jpg" media="(max-width: 1500px)"> <source srcset="flowers.jpg"> <img src="img_flowers.jpg" alt="Flowers" style="width:auto;"> </picture>
The reference site :- https://www.w3schools.com/html/html_responsive.asp
Share