0

I've made my nav ul width col-lg-10 and I want all the li elements to be spaced equally within this, is this possible? At the moment the li elements don't seem to fit the entire col-lg-8 width, they just sit in the middle of the div.

<!-- MENU -->
            <div class="row">
                <nav class="navbar navbar-default" role="navigation">
                    <div class="container-fluid">
                        <!-- 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 col-lg-8">
                               <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Who Are We</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/whoarewe/" ContainerCssClass="dropdown-menu"/>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">What's On</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/whats-on/" ContainerCssClass="dropdown-menu"/>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Your Voice</a>
                                    <MSL:Navigation ShowSectionNav="true"  SectionPageName="/your-voice/" ContainerCssClass="dropdown-menu"/>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Advice &amp; Support</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/advice/" ContainerCssClass="dropdown-menu"/>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Activities</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/activities/" ContainerCssClass="dropdown-menu"/>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Jobs &amp; Volunteering</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/jobs/" ContainerCssClass="dropdown-menu"/>
                                </li>

                                <li class="dropdown">
                                    <a href="/coopers/bar">Coopers Bar</a>
                                </li>

                                <li class="dropdown">
                                    <a href="/studenthub">Student Hub</a>
                                </li>

                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Contact Us</a>
<MSL:Navigation ShowSectionNav="true"  SectionPageName="/contact/" ContainerCssClass="dropdown-menu"/>
                                </li>
                            </ul>

                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </nav>
            </div>

CSS

    //out:null

    .navbar-default {
        background: #5f336d;
    }

    .navbar {

        margin: 0px;
        border-radius: 0px !important;

        .navbar-collapse {



@media (min-width: @grid-float-breakpoint) {
            text-align: center;
        }

        .nav, .nav > li {
            @media (min-width: @grid-float-breakpoint) {
                float:none;
                display:inline-block;
                *display:inline; /* ie7 fix */
                *zoom:1; /* hasLayout ie7 trigger */
                vertical-align: top;
            }
        }


    }

    a {
        font-weight: 600;
        font-size: @font-size-base;
        color: #fff !important;
    }


    .dropdown:hover, .dropdown.open {
        position:relative;

        &:after {
            content: '';
            position:absolute;
            top:0;
            left:0;
            height:3px;
            background-color: @brand-primary;
            width:100%;
            z-index:99999;
        }
    }

    .dropdown.open > .dropdown-menu > ul {
        list-style: none;
        padding: 0 0 0 18px;
    }

    .dropdown-menu {
        min-width:190px;
    }

}
user2953989
  • 2,791
  • 10
  • 36
  • 49
  • Possible duplicate of [How to stretch a fixed number of horizontal navigation items evenly and fully across a specified container](http://stackoverflow.com/questions/5060923/how-to-stretch-a-fixed-number-of-horizontal-navigation-items-evenly-and-fully-ac) – StudioTime Aug 02 '16 at 14:29
  • What is the ` – Ronen Cypis Aug 02 '16 at 14:33

0 Answers0