How to show Retina images for websites with HTML?

Spread the love

Sometimes, we want to show Retina images for websites with HTML.

In this article, we’ll look at how to show Retina images for websites with HTML.

How to show Retina images for websites with HTML?

To show Retina images for websites with HTML, we set the srcset attribute.

For instance, we write

<img src="low-res.jpg" srcset="high-res.jpg 2x" />

to set the srcset attribute toi the URL with the high quality image.

Conclusion

To show Retina images for websites with HTML, we set the srcset attribute.

Leave a Reply

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