Display flex vertical alignment and responsiveness or position absolute?
I'm trying out various ways to do this and so far only position absolute made sense to me to get accurate spacing. With display flex there was a lot of spacing issues which were solved with margins but way too much tweaking was involved. Any advice on which other approach you suggest and please explain why over display flex or etc.
Thank you.
https://codepen.io/3dharp/pen/KKGKZNo
6 Replies
updated code:
.loading {
background-color: $color-dark;
width: 100;
height: 100vh;
overflow-y: hidden;
&__wrapper {
display: flex;
flex-direction: column;
align-items: center;
}
&__heading {
position: absolute;
top: 60px;
}
&__image {
height: calc(100vh);
display: flex;
align-items: center;
justify-content: center;
img{
height: 570px;
width: 550px;
border-radius: 4px;
}
// object-fit: cover;
}
&__counter {
position: absolute;
bottom: 60px;
}
}
I'd consider using grid here.
on the parent:
oh and you'd put in some empty divs for grid to see those children elements to fill in those gap spaces
sorry man, I'm on lunch break so I answer a few of these for fun, but don't have the free time to do it extensively. But you're welcome to add me on Linked in and shoot me some questions form time to time.
https://rowe2ry.com
sure sounds good
css grid is interesting approach but adding many divs, isnt that way too much extra code when not needed>
?*
You've been told this isn't allowed. You've also made multiple threads for the same topic
deleted