Conan
Conan

Reputation: 33

Boostrap 4 img-responsive does not work fully

Since bootstrap 4 came out i'm using it.

I saw you can't use the.

class="img-responsive"

So i used this:

.img-fluid{
max-width: 100%;
height: auto;

But it does not work fully cause when i half the screen it's only img-fluid, Is there a way to let it work like the img-responsive or does it needs to be fixed?

Greets,

Conan

Upvotes: 0

Views: 495

Answers (3)

MrOrhan
MrOrhan

Reputation: 1114

I use <img class="img-fluid" src="myimage.png"> and it works fine.

When I minimize my screen, the image also minimize automatically (it scales with the parent element).

Maybe you can post some code, so we can understand ur problem better?

Upvotes: 0

Blackmask
Blackmask

Reputation: 191

you can add this classcard-img-top

HTML

<img src="your images link" class="card-img-top" alt="...">

CSS

img {
  height: auto;
  max-width: 100%; }

Upvotes: 0

Tes3awy
Tes3awy

Reputation: 2266

In Bootstrap 4, the .img-responsive is changed to be .img-fluid. For more info about migrations from BS3 to BS4 visit this link

Upvotes: 1

Related Questions