Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

img-responsive in Bootstrap does not work

according to http://getbootstrap.com/css/#images-responsive, I want to make my image to support a responsive website by using

<img src="..." class="img-responsive" alt="Responsive image">

But it is not working.

Here is my code,

<body>
    <img class="img-responsive" src="images/myImage.png" />
</body>

The original image size is 284x191

When I open a browser on 1920*1080 screen size, the image size is 284x191. But when I open a browser on 1280*720 screen size, the image size is still the same.

I don't know what I did wrong to reduce the image size dynamically. Thanks for help.

like image 827
Hikaru Shindo Avatar asked Feb 25 '16 08:02

Hikaru Shindo


1 Answers

In Bootstrap 4 the syntax is class="img-fluid"

like image 61
Michael Avatar answered Nov 14 '22 09:11

Michael