Fearghal
Fearghal

Reputation: 11417

why is my navbar not full width

I have a simple navbar, but it refuses to go the uill 12 col width.

         <!--Mobile NAV BAR ROW-->
    <div class="row row-nomargin">
        <div class="col-md-8 col-md-offset-2">                 
          <nav class="navbar navbar-default navbar-left">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </button>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                  <ul class="nav navbar-nav navbar-right">
                    <li class="active"><a href="/home.html">Home</a></li>
                    <li><a href="/gallery.html">Gallery</a></li>
                    <li><a href="/pricing.html">Pricing</a></li>
                    <li><a href="/aboutus.html">About us</a></li>
                    <li><a href="/contactus.html">Contact us</a></li>
                    </a></li>
                  </ul>
                </div><!-- /.navbar-collapse -->
            </nav>
        </div>
    </div>

Its priob something i've overwritten in css (i shouldn't do that) but i cant see what

   .navbar .nav > li > a {
    color:  white;
    }
   .navbar-default {
        /*Overwrites bootstrap css*/
        box-shadow: 
        border: 0;
       margin-bottom:0; 
        /*background-image: url('../img/navbarbackground1.png');*/
       font-family: 'Cooper Black';
       background-color: rgb(1,165,228);
       /*background-color: rgba(0,0,0,0.0);*/
       /*border: 2px dashed #FFFFFF;box-shadow: 0 0 0 0px #A0785A, 2px 0px 20px 0px;*/
    }

    .navbar-fixed-bottom {
        /*Overwrites bootstrap css*/
        background-image: url("../img/backgroundImage.jpg");
    }

    .nav-tabs{
        /*MFOHARE Specific css*/
        right: 0px;
        color: white;
    }


.row-nomargin{
    margin: 0px;
}

Any ideas whats goimng on here - my navbar is only as wide as the links on it.

Upvotes: 0

Views: 889

Answers (1)

philnash
philnash

Reputation: 73047

You have the class navbar-left on your nav element. navbar-left does one thing:

.navbar-left {
  float: left !important;
}

So your entire nav will float left and shrink to fit the items within it. You can probably just remove that class and it will fix your issue.

Upvotes: 2

Related Questions