I am solving a challenge and i am unable to fix a box at bottom header where half box will be inside header and the other half will be out of header with fully responsive. I tried it do with positions and bottom but when i change responsiveness more than half portion of box goes inside header or sometime more than half portion goes outside of header. i want that box size always fix at half inside bottom.
i want to align box like this:
position: relative
on the parent elementposition: absolute
to the child elementtop: 100%
transform: translateY(-50%)
.parent {
position: relative;
}
.child {
position: absolute;
top: 100%;
transform: translateY(-50%)
}
/* for visualization purpose only */
.parent {
border: 2px dashed red;
min-height: 30vh;
}
.child {
border: 2px solid blue;
min-height: 15vh;
width: 40vw;
}
div {
display: flex;
justify-content: center;
align-items: center;
}
<div class="parent">
Parent
<div class=child>Child</div>
</div>