I am facing a challenge with this issue:
I want to position a red div at the bottom of another div.
The red div should always stay at the bottom of its parent div.
.homepage-wrapper{
max-width: 1028px;
margin-left: auto;
margin-right: auto;
}
.homepage-top-category-container-title{
background-color: black;
margin-bottom: 10px;
padding: 15px 0 15px 0;
}
#homepage-top-category-container-title{
color: orange;
}
.homepage-top-category-container-list{
display: flex;
flex-wrap:wrap;
width: auto;
height: auto;
background-color: yellow;
}
.homepage-top-category-container-item{
display: block;
float: none;
width: auto;
height:auto;
border: solid 1px black;
}
#homepage-top-category-container-item-a{
width: 240px;
height: 360px;
}
#homepage-top-category-container-item-b{
margin-left: 20px;
width: 240px;
height: 360px;
}
#homepage-top-category-container-item-c{
margin-left: 20px;
width: 240px;
height: 360px;
}
#homepage-top-category-container-item-d{
margin-left: 20px;
width: 240px;
height: 360px;
}
.test{
position:relative;
bottom:0;
background-color: red;
}
<div class="homepage-wrapper">
<div class="homepage-top-category-container">
<div class="homepage-top-category-container-title">
<span id="homepage-top-category-container-title">Most popular aisles</span>
</div>
<div class="homepage-top-category-container-list">
<div class="homepage-top-category-container-item" id="homepage-top-category-container-item-a">
block A
<div class="test">
button
</div>
</div>
<div class="homepage-top-category-container-item" id="homepage-top-category-container-item-b">
block B
</div>
<div class="homepage-top-category-container-item" id="homepage-top-category-container-item-c">
block C
</div>
<div class="homepage-top-category-container-item" id="homepage-top-category-container-item-d">
block D
</div>
</div>
</div>
</div>
Any assistance from our community would be greatly appreciated. Thank you.