Community forum for knowledge and support

Updated 4 months ago

Navbar 13 not centering despite following instructions

At a glance

A community member has a question about Navbar 13 - they followed the instructions exactly but the navbar is still not centered. Another community member shares a read-only link to their website. After some discussion, @Matt provides a solution, suggesting the community member should have a different structure for their HTML elements, with the navbar and footer sandwiching the main content wrapper. The community members find this advice helpful and appreciate learning something new.

Useful resources

Hey everyone, I have a question about Navbar 13. I followed the instructions exactly (added the navbar-on-page class to the page wrapper and max-width-full to the main wrapper), but the navbar is still not centered. Can anyone help?

M
D
5 comments

@Dávid Drímal would you mind sharing a read-only link?

Hi, @Matt did you manage to find where the problem is?

@Dávid Drímal thanks for the bump! Yeah so you'll want to have your divs stacked a different way. For semantics and accessibility you'll want page-wrapper, navbar, main-wrapper, sections, footer. So navbar and footer should sandwich the main-wrapper. You'll notice that the navbar, main-wrapper, and footer are not actually divs but are nav, main, and footer tags.

Great, thanks for the advice @Matt it works as it should, every day one learns something new

Add a reply
Sign up and join the conversation on Slack