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
Tushar Saraf
7,101 PointsCustomize navbar in Bootstrap 4
Hi there,
Thank you for checking out this question.
I wanted to align all the anchor link (Home, Services etc) to the right side of the page.
Here's my code
<header> <nav class="navbar navbar-toggleable-md fixed-top navbar-custom navbar-inverse"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" alt="Logo"></a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav navbar-right">
<li class="nav-item active">
<a class="nav-link" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about_us">Who We are</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#usp">Why Choose us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#services">Services</a>
</li>
</ul>
</div>
</nav>
</header>
1 Answer
Tushar Saraf
7,101 PointsIt didn't work!
bronsonroybal
16,715 Pointsbronsonroybal
16,715 PointsI believe all you need to do is add "justify-content-end" to the nav class, where you put fixed-top and navbar-inverse.