My layout includes bootstrap v4 cards, but I'm having issues with distorted images in Internet Explorer 11. It seems that IE is not recognizing the height: auto
attribute from the img-fluid
class. Should I set a custom height for the card images? Interestingly, the cards display perfectly in Chrome and Firefox. When I switch to IE 10 (in the F12 console), the problem disappears.
I noticed that images with the class img-fluid
that are not within cards maintain their original ratio without distortion. This leads me to believe that the issue lies within the card layout itself.
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card">
<img class="card-img-top img-fluid" src="img/1.jpg" alt="Step 1" width="600" height="400" />
<div class="card-block">
<h3 class="card-title">Step 1</h3>
<p class="card-text">Text 1</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img class="card-img-top img-fluid" src="img/2.jpg" alt="Step 2" width="600" height="400" />
<div class="card-block">
<h3 class="card-title">Step 2</h3>
<p class="card-text">Text 2</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img class="card-img-top img-fluid" src="img/3.jpg" alt="Step 3" width="600" height="400" />
<div class="card-block">
<h3 class="card-title">Step 3</h3>
<p class="card-text">Text 3</p>
</div>
</div>
</div>
</div>
</div>