Use CSS max-width property for responsive image

You can try to run the following code to implement the max-width property for the responsive image


Live Demo

<!DOCTYPE html>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1.0">
         img {
            max-width: 100%;
            height: auto;
      <p>To check the effect, you need to resize the browser.</p>
      <img src = "" alt = "Python Data Science" width = "400" height = "300">