@hady68
Posted
@skadanka Hello Eden, your development looks good, to make the content positioned in the center, you can apply the following CSS styles to the body tag:
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
Marked as helpful
@skadanka
Posted
@hady68 Thanks for the feedback, from my understanding setting fixed height is not recommended, there is another way to achieve the same results?
@hady68
Posted
@skadanka That's not true for all cases, sometimes, the body is not taking the height it is supposed to, because we have not initiated the size, that's where the 100vh
comes in play as per me, also considering your point I agree that static is not always the best.
Here's an article you can follow to look through some other ways as well - via flexbox https://dev.to/fenok/stretching-body-to-full-viewport-height-the-missing-way-2ghd
Hope it helps π
Marked as helpful