I have Bootstrap v4 problem. When the navbar switches to the hamburger icon on small screen, I'd like to add a phone icon so mobile users can easily use it, never scrolling down to the Contact section.
I've been trying to use Bootstrap docs regarding navbar
and an example from
Adding a phone and map icon to the left of the bootstrap hamburger icon (adjusting it to Bootstrap v4 by using d-md-none
instead of obsoleted visible-xs
). Also I've read through and tried every suggestion from Bootstrap 4 align navbar item to the right playing with mr-*
, ml-*
, justify-*
, float-*
but no success - when I resize viewport to the smaller screen, the icon appears yet it keeps get aligned under the brand or hamburger menu icon depending on what I use - mr-*
or ml-*
, but I want it to stick to the left of the hamburger icon and do not mess around.
Here is the latest iteration of what I have:
<!-- Navbar Start -->
<nav class="navbar navbar-expand-lg fixed-top scrolling-navbar indigo">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a href="index.html" class="navbar-brand"><img class="img-fluid" src="img/logo.png" alt=""></a>
<ul class="navbar-nav d-md-none">
<li class="nav-item ml-auto">
<a class="nav-link page-scroll" href="tel:+1234567890"><i class="lnr lnr-phone-handset"></i></a>
</li>
</ul>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
<i class="lnr lnr-menu"></i>
</button>
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="navbar-nav mr-auto w-100 justify-content-end">
<li class="nav-item">
<a class="nav-link page-scroll" href="#hero-area">Home</a>
</li>
<li class="nav-item">
<a class="nav-link page-scroll" href="#services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link page-scroll" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>