I am new to web design and have created a small portfolio gallery. Each 'card' in the gallery includes an image, title, and caption. However, I'm facing an issue where some cards appear larger due to longer captions. I want each card to adjust its position in a staggered grid layout.
Despite trying various CSS adjustments like changing margins and other tricks, I haven't been able to solve this problem.
<style>
.column {
float: left;
width: 50%;
align-content: inherit;
padding: 5px 10px;;
border-collapse: collapse;
}
.content {
background-color: #F1F0F0;
padding: 20px 20px 8px 20px;
}
h3 {
color: #8A6E4B
}
@media screen and (max-width: 900px) {
.column {
width: 100%;
}
}
@media screen and (max-width: 600px) {
.column {
width: 110%;
}
}
</style>
<div class="row">
<div class="column">
<div class="content">
<img src="a/6711" />
<h3>Title 01</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
<div class="column">
<div class="content">
<img src="a/6705" alt="Title 02" style="width: 100%;" />
<h3>Title 02</h3>
<p>Lorem ipsum dolor sit amet.</p>
</div>
</div>
</div>
<div class="row">
<div class="column">
<div class="content">
<img src="a/6709" alt="Title 03" style="width: 100%;" />
<h3>Title 03</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>
<div class="column">
<div class="content">
<img src="a/6714" alt="Title 04" style="width: 100%;" />
<h3>Title 04</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>