I am working on aligning my navigation bar vertically, even when I scroll the page.
I found a method in another thread which suggests using the following CSS code for vertical alignment:
#container
{
position: absolute;
top: 50%;
height: 400px;
margin: -200px 0;
}
However, I do not want to hardcode the size of the navigation bar. Can anyone suggest a way to vertically align the navigation bar without specifying its size?
I have searched on Google but most of the results provide outdated methods or require hardcoding the size. If there is a resource that addresses this issue, please let me know!
Thank you.