Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Bootstrap Basics Using Bootstrap Components Building a Navbar

Yu-Yang Hsiao
Yu-Yang Hsiao
6,295 Points

Question about navbar

Hi there, I was wondering that is there any chance i can place the navbar vertically on the right or left side instead horizontally? Thanks for helping :)

Jamaal Burden
Jamaal Burden
9,495 Points

Yeah, it is possible try changing you display to inline-block I know they will go over it in later video it easier to do with bootstraps

Yu-Yang Hsiao
Yu-Yang Hsiao
6,295 Points

Thanks so much for the information. Happy coding:)

Hi, you could first declare your navbar display property as inline-block. This will let it behave like as both a block or inline level element. Secondly, you can add a text-align property to the navbar css rule and set a value of either right or left to position it on the direction you wish. I hope this will help you out.

1 Answer

You must consider first how much width your nav-items should have after that there are plenty way to place them vertically. 2 of them are mentioned in the CSS Layout course (display: inline-block / float) but you also can use flexbox and grid-layout or both combined. It wouldn't be easy to explain everything, check the courses and you'll find answers for all your questions. ;)

Yu-Yang Hsiao
Yu-Yang Hsiao
6,295 Points

Thanks so much for the information :) really appreciate that ~ Happy coding