Issue: The justify-content-end
class is not functioning as expected in the navbar
while using Bootstrap 4.
Scenario: I have decided to delve into css without writing custom CSS from scratch. To get a grasp of it, I attempted to build a navbar
by copying the code directly from the bootstrap documentation:
<nav class="navbar navbar-expand-lg navbar-light bg-light col-12">
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</nav>
The justify-content-end
class has been included in the navbar
. Even after verifying that the styles are being applied through devtools, the list of nav-links
remains on the left-hand side instead of right-aligned.
https://i.sstatic.net/N1mcQ.png
However, in the bootstrap docs, the same code displays the alignment correctly as shown below.
https://i.sstatic.net/zbuCG.png
Am I overlooking something crucial here?