By using the width property
Set the CSS width property to 100% to make the image responsive and scale up and down.
Example:
<!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <body> <h2> Responsive Image </h2> <p> When we set the CSS width property to 100%, it makes the image responsive. Resize the browser window to see the effect. </p> <img src="logo-192x192.png" style="width:100%;"> // change image </body> </html>