How to make an image responsive in HTML?

HTMLWeb DevelopmentFront End Technology

To make an image responsive, you need to set two properties. Add image using the <img> tag and add CSS style for height and max-width to make it responsive. For example, style="height:auto;max-width:100%;"

You can try to run the following code to make an image responsive in HTML −
Note − To check the responsiveness of an image, resize the browser tab. If the image resizes correctly, then it means it is responsive.


<!DOCTYPE html>
      <img src="" alt="Video Tutorials" style="height:auto;max-width:100%;">


Updated on 22-Dec-2021 10:42:03