Trying to learn website layouts creation using the newest bootstrap 4 alpha 4
(in conjustion with jQuery 3
) and in this question I would would like to cover 1 issue which I have come across so far.
- When I click on "menu" button in navbar "collapsed mode" - drop down list drops in the center and then shifts to the left side. This looks awful. Problem explained:
Why does this happen and how do I force the list to to always drop down from right side instead (and stay there after animation)?
Here is the fiddle: http://jsfiddle.net/Wy22s/1073/
Edit: in accepted solution there is no right align.. Note that in fiddle there is class pull-xs-right
for navbar but it doesn't kick-in:
http://jsfiddle.net/Wy22s/1075/
So I went ahead and made my own solution by adding clearfix div
before navbar:
<a class="navbar-brand" href="#">Website</a>
<div class="clearfix hidden-sm-up"></div>
<div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar1">
<!-- <a class="navbar-brand" href="#">Fixed bottom</a> -->
<div class="nav navbar-nav pull-xs-right">
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="#">Features</a>
<a class="nav-item nav-link" href="#">Pricing</a>
<a class="nav-item nav-link" href="#">About</a>
</div>
</div>
so in the end I am using this approach (no CSS
changes required):