css3 - CSS drop-down menu: z-index issue -


i've got 2 problems css drop-down menu: jsfiddle

1) transitions: menu slide-down when mouse switches open it. opened menu should slide-up close.

#nav ul li ul {     -webkit-transition:height .5s ease-in;     -moz-transition:height .5s ease-in;     -o-transition:height .5s ease-in;     -ms-transition:height .5s ease-in;     transition:height .5s ease-in; } 

this doesn't seem work; possibly under wrong "ul li" selector, though tried others.

2) bring parent item ("menu1", "menu2") on top of menu item list covers top border of first child. is, there should no border between "menu1" , "item1" since "menu1" doesn't have bottom border, looks since "item1" on top of it.

tried playing z-index, can't working. neither transitions.

i realize menu bit convoluted , has more css necessary.

what it? jsfiddle

#nav ul {      padding: 0;      margin: 0;      list-style: none;  }    #nav ul li {      display: inline-block;      border: 1px solid #fff;      border-bottom: 0;      border-radius: 5px;      margin: 0 15px;      position: relative;      -webkit-transition: border-color 0.2s ease-in;      -moz-transition: border-color 0.2s ease-in;      -o-transition: border-color 0.2s ease-in;      -ms-transition: border-color 0.2s ease-in;      transition: border-color 0.2s ease-in;  }    #nav ul li {      color: #8799b3;      display: block;      padding: 10px 6px;      border: 0;      -webkit-transition: color 0.2s ease-in;      -moz-transition: color 0.2s ease-in;      -o-transition: color 0.2s ease-in;      -ms-transition: color 0.2s ease-in;      transition: color 0.2s ease-in;  }    #nav ul li:hover {      color: #415161;      border-color: #e9e9e9;  }    #nav ul li a:hover {      color: #415161;  }    #nav ul li ul {      opacity: 0;      visibility: hidden;      text-decoration: none;      line-height: 1;      color: #8799b3;      background: #fff;      position: absolute;      top: calc(100% - 5px);      left: -1px;      z-index: 1000;      width: 165px;      border: 0;  }    #nav ul li:hover ul {      opacity: 1;      visibility: visible;  }    #nav ul li ul li {      border: 0;      display: block;      font-size: 14px;      margin: 0;      -webkit-transition: background 0.2s ease-in;      -moz-transition: background 0.2s ease-in;      -o-transition: background 0.2s ease-in;      -ms-transition: background 0.2s ease-in;      transition: background 0.2s ease-in;  }    #nav ul li ul li:hover {      border: none;      color: #415161;      background: #f7f9fb;  }    #nav ul li ul li {      padding: 10px;      border: none;      color: #8799b3;      border-left: 1px solid #e9e9e9;      border-right: 1px solid #e9e9e9;      border-bottom: 1px solid #e9e9e9;  }    #nav ul li ul li:first-child {      border-top: 1px solid #e9e9e9;      border-radius: 0 5px 0 0;  }    #nav ul li ul li:last-child {      border-bottom: 1px solid #e9e9e9;      border-radius: 0 0 5px 5px;  }    #nav ul li ul {      -webkit-transition: opacity 0.2s ease-in;      -moz-transition: opacity 0.2s ease-in;      -o-transition: opacity 0.2s ease-in;      -ms-transition: opacity 0.2s ease-in;      transition: opacity 0.2s ease-in;  }
<div id="nav">      <ul>          <li>              <a href="#">menu1</a>              <ul>                  <li><a href="menu.html">item1</a></li>                  <li><a href="menu.html">item2</a></li>                  <li><a href="menu.html">item3</a></li>                  <li><a href="menu.html">item4</a></li>              </ul>          </li>          <li>              <a href="#">menu2</a>              <ul>                  <li><a href="menu.html">item1</a></li>                  <li><a href="menu.html">item2</a></li>                  <li><a href="menu.html">item3</a></li>                  <li><a href="menu.html">item4</a></li>              </ul>          </li>          <li>              <a href="#">menu3</a>              <ul>                  <li><a href="menu.html">item1</a></li>                  <li><a href="menu.html">item2</a></li>                  <li><a href="menu.html">item3</a></li>                  <li><a href="menu.html">item4</a></li>              </ul>          </li>      </ul>  </div>


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -