html - Hidden <ul> vanishes while hovering between <li> to it -


below have hidden <ul> appears when <li> 'more' hovered over.

due margin of <li>, <ul> dissapears when hovering between 'extras' , <ul> - how prevent happening?

#container ul {    list-style: none;    margin: 0px;    padding: 0px;  }  #container li {    color: #fff;    width: 80px;    height: 60px;    float: left;    line-height: 60px;    margin: 10px;    background: black;  }  #container li {    display: block;  }  .extras:hover > ul.hidden {    display: block;  }  ul.hidden {    display: none;  }
<div id="container">    <div class="center" style="text-align: center; display: inline-block;">      <nav>        <ul class="nav">          <li>example 1</li>          <li>example 2</li>          <li class="extras">more            <ul class="hidden">              <li>hoverable</li>              <li>hoverable</li>              <li>hoverable</li>            </ul>          </li>          <li>example 3</li>          <li>example 4</li>        </ul>      </nav>    </div>  </div>

your ul tag not getting height. here try this

#container ul {    list-style: none;    margin: 0px;    padding: 0px;    float:left;    width:100%;  }  #container li {    color: #fff;    width: 80px;    height: 60px;    float: left;    line-height: 60px;    margin: 10px;    background: black;  }  #container li {    display: block;  }  .extras:hover > ul.hidden {    display: block;  }  ul.hidden {    display: none;  }
<div id="container">    <div class="center" style="text-align: center; display: inline-block;">      <nav>        <ul class="nav">          <li>example 1</li>          <li>example 2</li>          <li class="extras">more            <ul class="hidden">              <li>hoverable</li>              <li>hoverable</li>              <li>hoverable</li>            </ul>          </li>          <li>example 3</li>          <li>example 4</li>        </ul>      </nav>    </div>  </div>


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -