I'm making a album page with HTML and CSS and I want to set my height of the image to be 9/16 of the width.
HTML code
<div class = "col-md-12" id = "album-list">
<div class = "col-md-4">
<div id = "album-card" style = "border: 1px solid grey;">
<img class = "image_thumbnail" src = "images/sampleImage.jpg" alt = "Thumbnail" />
<div style = "padding-top: 10px; padding-bottom: 5px;">
<p class = "card-text"><strong>TITLE HERE</strong></p>
</div>
</div>
</div>
<!-- More Columns -->
</div>
CSS style
.image_thumbnail {
width: 100%;
}
I saw some posts on stackoverflow with similar questions, and the answer was to use padding-bottom
to set the height according to the width. However, since I gave border around #album-card
, #album-card
gets longer in height than it's supposed to be.
How can I set the heigth 9/16 of the width??