I've been attempting to vertically align 2 divs using a flexbox, similar to the layout shown here: desired alignment
However, I'm encountering an issue where the second div containing the picture description is always positioned to the left: current display setup
Am I overlooking something in terms of aligning these 2 divs with flexbox, or is there a better approach?
Thank you for your assistance!
Sherlock
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.thumb {
width: 300px;
margin-bottom: 50px;
display: flex;
justify-content: center;
align-items: center;
flexbox-direction: column;
}
.thumb img {
max-width: 300px;
max-height: 300px;
transition: all 0.5s;
margin-bottom: 1rem;
}
.thumb .museum-label {
padding: 1em;
background: white;
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.50);
width: 200px;
color:#2E3225;
}
.thumb .museum-label .artist{
font-weight: bold;
display: block;
}
.thumb .museum-label .title{
font-style: italic;
}
</style>
</head>
<body>
<div class="thumb">
<a href="framing.html">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Pieter_Bruegel_the_Elder-_The_Harvesters_-_Google_Art_Project.jpg/800px-Pieter_Bruegel_the_Elder-_The_Harvesters_-_Google_Art_Project.jpg" alt="Venice, from the Porch of Madonna della Salute">
<div class="museum-label">
<span class="artist">Pieter Bruegel the Elder</span>
<span class="title">The Harvesters</span>,
<span class="date">1565</span>
</div>
</a>
</div>
</body>
</html>