Create Responsive images using only css

0 views - 1 minute readEdit this post

I rely on your support to keep this website running. If you find the content valuable, please consider making a small donation. whether it’s ₹25/$1 or ₹500/$5.

Donate

Secured by Stripe

By adding 100% max-width and adding auto height we can make image resize automatically according to the width of the device.

Demo

img {
  max-width: 100%;
  height: auto;
}

Did you enjoyed the post?

Twitter (x)