mardi 28 juin 2016

bootstrap navbar dropdown menu background not working

To simplify this as much as possible, i am basically adding a bootstrap navbar to a page, one of the tabs has a dropdown menu which has a choice of 5 sub options. I have found that the background is only showing to the bottom of the first sub option. The CSS sets the height to 100% which is what i would like, if i change the CSS to say 500px; it will expand the area.

<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
            <ul class="nav navbar-nav">
                <li><a class="active" href="index.html">Home</a></li>
                <li><a class="li" href="whatido.html">What I Do</a></li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown"    href="#">Travels<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Asia</a></li>
                        <li><a href="#">Europe</a></li>
                        <li><a href="#">Scotland</a></li>
                        <li><a href="#">Other</a></li>
                        <li><a href="#">And Another</a></li>
                    </ul>
                </li>
                <li><a class="li" href="upcomingtrips.html">Upcoming Trips</a></li>
                <li><a class="li"href="aboutme.html">About Me</a></li>
                <li><a class="li" href="gallery.html">Gallery</a></li>
                <li><a class="li" href="contactpage.html">Contact</a></li>
            </ul>
        </div>
    </div></nav>
</nav>

the css for the dropdown is simple

  .dropdown-menu {
      height:100%;
}

the result :

adjustable size however if i change the css to

  .dropdown-menu {
      height:300px;
}

i get this result

fixed size Im struggling to understand why the 100% option doesn't cover the entire area when each sub option is included in the 'dropdown-menu' ul class?




Aucun commentaire:

Enregistrer un commentaire