Problem: When I resize my screen, some titles exceed one line of text. This causes my layout to look weird.
Preferred solution: The image, title and subtitle stay where they are. The more button is aligned at the bottom of the div and the div height is determined by the highest item in that row. This all has to be responsive, so a fixed height won't be a solution.
PHP
<section id="disc-overview">
<?php
$sql = "SELECT id, title, date_released, produced_by, arranged_by, recorded_at, seo_link, taken_from FROM discography_overview WHERE artist = '1' AND type = '$type' ORDER BY date_released DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$id = $row["id"];
$title = $row["title"];
$date_released = $row["date_released"];
$date = DateTime::createFromFormat('Y-m-d', $date_released);
$date_released = $date->format('F jS, Y');
$produced_by = $row["produced_by"];
$arranged_by = $row["arranged_by"];
$recorded_at = $row["recorded_at"];
$seo_link = $row["seo_link"];
$taken_from = $row["taken_from"];
echo "
<div class=\"col-sm-3 disc-overview row-eq-height\">
<div class=\"col-sm-12 text-center wow fadeInLeft\">
<img alt=\"$title\" src=\"/images/discography/$seo_link-1.jpg\">
</div>
<h3 class=\"card-title\">$title</h3>
<h4 class=\"card-subtitle\">$date_released</h4>
<a href=\"/$type/$seo_link/\" title=\"Show details of $title\">
<button class=\"btn btn-card\">MORE</button>
</a>
</div>";
}
}?>
</section>
CSS:
#disc-overview {
padding-top: 50px;
background-color: #ffffff;
display: table;
width: 100%;
}
.disc-overview {
background-color: #ffffff;
text-align: center;
padding-bottom: 50px;
display: table-cell;
}
.disc-overview img {
width: 100%;
vertical-align: middle;
padding-bottom: 30px;
}
.card {
text-align: center;
border: 0;
background: none;
padding-left: 0;
padding-right: 0;
margin-bottom: 0;
position: absolute;
}
.card-title {
text-align: center;
color: #000000;
letter-spacing: -1px;
font-weight: 600;
font-size: 20px;
}
.card-subtitle {
margin-bottom: 0;
font-style: italic;
font-weight: 400;
font-size: 15px;
font-family: "Lora", serif;
color: #5b5b5b;
margin-top: -1rem;
line-height: 1.7857;
padding-bottom: 1rem;
text-align: center;
}
.btn-card {
background-color: #404040;
border-color: #404040;
letter-spacing: 2px;
padding: 10px 20px;
horiz-align: center;
color: #ffffff;
}
.btn-card:hover {
background-color: #f5f5f5;
color: #404040;
border-color: #404040;
letter-spacing: 2px;
padding: 10px 20px;