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.


Live Demo

<!DOCTYPE html>
      <img src="" alt="Video Tutorials" style="height:auto;max-width:100%;">
Published on 01-Feb-2018 06:41:18