I have a list of articles and want all their images to be the same height so that the article titles line up vertically.
I tried setting a fixed height, such as 200px, to the images but this is causing them to look squished.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.article {
margin-bottom: 24px;
width: 100%;
}
.image {
width: 100%;
display: block;
height: auto;
}
.article__category {
margin: 12px 0;
padding: 2px 4px;
display: inline-block;
}
<article class="article">
<div class="article__image">
<a href="#">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1774776/ceremony.jpg" class="radius-small image">
</a>
</div>
<div class="article__category radius-small">
<a href="#">
<span>New Track</span>
</a>
</div>
<h1 class="article__title">
<a href="#">Ceremony: <em>“Turn Away The Bad Thing” Video</em>
</a>
</h1>
</article>
<article class="article">
<div class="article__image">
<a href="#">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1774776/joyero_copy.jpg" class="radius-small image">
</a>
</div>
<div class="article__category radius-small">
<a href="#">
<span>Music Video</span>
</a>
</div>
<h1 class="article__title">
<a href="#">Joyero: <em>“Dogs” Video</em>
</a>
</h1>
</article>
I want the images to all be the same height without ruining their proportions.