Set width of Bootstrap Navbar in CSS

nedash
 
on Dec 09, 2020 10:43 PM
4612 Views

hi

I use bootstrap and use the navbar below are codes:

How to set width for navbar in bootstrap 4.3.1

  <div id="collapse">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
      <a class="navbar-brand" href="#"></a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
          <li class="nav-item active">
            <a class="nav-link">ContactUs</a>
          </li>
          <li class="nav-item">
            <a class="nav-link">AboutUs</a>
          </li
        </ul>
      </div>
    </nav>
  </div>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
nedash
 
on Dec 17, 2020 09:05 AM

I changed below code and it woked nice:

.navbar-toggler {
    font-size: 1.25rem;
    line-height: 1;
    /*background-color: transparent;*/
    background-color:#000;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.bg-light {
    min-width:37px !important;
    position: fixed !important;
    right: 0 !important;
    width:100% !important;
}

best regards

Neda