In my case an absolutely positioned child element carouselbuttonCntainer
is going far some pixels below parent div bgCoverSection
when I set it's bottom value as zero.
HTML:
<div class="bgCoverSection" id="homePageSection">
<div id="carouselbuttonCntainer">
<div id="carouselbuttonInnerCntainer">
<input type="radio" class="imageCarouselRadioButton"
name="imageCarouselRadioButton" checked="checked">
<input type="radio" class="imageCarouselRadioButton"
name="imageCarouselRadioButton">
<input type="radio" class="imageCarouselRadioButton"
name="imageCarouselRadioButton">
</div>
</div>
</div>
CSS:
//parent
.bgCoverSection{
height: 614px;
width: 100%;
padding: 0px;
background-color: aqua;
text-align: center;
}
//child
#carouselbuttonCntainer{
position: absolute;
bottom: 0;
left: 50%;
}
.imageCarouselRadioButton{
width: 20px;
height: 20px;
}
In the code above code I set carouselbuttonCntainer
bottom to 0, it's bottom doesn't align with bottom of parent bgCoverSection
.
But when I set carouselbuttonCntainer
top to 0, it's top will align with top of parent bgCoverSection
.