Call: +123456789 | Email: admin@horje.com

Google Ads

Learn HTML Responsive Show Different Images Depending on Browser Width – HTML Code


Learn HTML Responsive Web Design Show Different Images Depending on Browser Width

The HTML <picture> element allows you to define different images for different browser window sizes.

Resize the browser window to see how the image below change depending on the width:

 

Code:

<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>

 

Try Your Self ->

 

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *