On my webpage, I have a navigation bar and a lot of content. The code structure looks something like this:
.container {
display: flex;
justify-content: center;
align-items: center;
}
<div class="navbar">
<!-- Various links for navigation bar -->
</div>
<div class="container">
<!-- Content here -->
</div>
I'm trying to figure out how to center the container
vertically within the body
while keeping the navbar
at the top. Right now, both elements are centered, which is not what I want.
Is there a way to achieve vertical centering for the container
in the body
without affecting the alignment of the navbar
? Any suggestions?