html - Super quick CSS nested list won't hide -


i cannot figure out life of me why nested lists aren't hiding. copied stylesheet did @ uni (that worked fine) dot. try can hide second tier!

it's super simple, i'm having blank when start long.

/*main nav*/  #nav {  	height: 45px;  	width: 960px;  }  #nav li {  	text-align: center;  	display: inline-block;  	background-color:white;  	width: 188px;  	height: 35px;  	padding-top: 10px;  }  #nav li:hover {  	background-color: white;  }  #nav ul {  	list-style: none;  }  #nav {  	text-decoration: none;  	color: black;  	}  #nav a:hover {  	color: white;	  }  /*sub nav*/  #nav li ul {  	display: none;  }  #nav li:hover ul {  	display: block;  	position: aboslute;  }  #nav li li {  	display: block;  	background-color: gray;  }  #nav li li:hover {  	background-color: white;  }
<div id="nav">  	<ul>      	<li><a href="#1">news</a></li>          <li><a href="#1">music</a></li>          	<ul>              	<li><a href="#2">artists</a></li>                  <li><a href="#2">free tracks</a></li>                  <li><a href="#2">labels</a></li>                  <li><a href="#2">genres</a></li>              </ul>          <li><a href="#1">school</a></li>              <ul>              	<li><a href="#2">interviews</a></li>                  <li><a href="#2">tips n tricks</a></li>                  <li><a href="#2">genre class</a></li>                  <li><a href="#2">promoters</a></li>              </ul>          <li><a href="#1">events</a></li>          	<ul>              	<li><a href="#2">coming up</a></li>                  <li><a href="#2">clubs</a></li>                  <li><a href="#2">festivals</a></li>              </ul>          <li><a href="#2">about</a></li>              <ul>              	<li><a href="#2">contact</a></li>                  <li><a href="#2">upload mix</a></li>                  <li><a href="#2">shop</a></li>              </ul>      </ul>  </div>	

thanks in advance, it's driving me crazy.

because has wrong syntax in html, didn't put sub ul li, it's out of li.

correct:

<li><a href="#1">music</a>     <ul>         <li><a href="#2">artists</a></li>         <li><a href="#2">free tracks</a></li>         <li><a href="#2">labels</a></li>         <li><a href="#2">genres</a></li>     </ul> </li> 

https://jsfiddle.net/xsolvv9u/


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -