troubleshooting Question

css drop down menu, submenu

Avatar of kublai_khan
kublai_khan asked on
CSSHTML
15 Comments2 Solutions343 ViewsLast Modified:
on start , i want to hide orange apple banana mango banana pear.
i want them to show only when user hovers over fruits

the code is ...

 li ul{
  display: none;
  position: absolute; 
  //top: 1em;
  //left: 0;
  }

i want to change it to something like this...

 li ul, li ul ul{
  display: none;
  position: absolute; 
  //top: 1em;
  //left: 0;
  }

What is the correct css?


You can see the complete html below.

<ul id = "nav" >
  <li>Sunfishes
    <ul>
		<div>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
			Conce Conce Conce Conce Conce Conce Conce <br>
		</div>
      <li><a href="">Sunfish</a></li>
      
	  <li>
		Fruits
		<ul>
			<li><a>Orange</a></li>
			<li>Apple</li>
			<li>Banana</li>
			<li>Mango</li>
			<li>Pear</li>
		</ul>
	  </li>
	  
      <li><a href="">Ozark bass</a></li>
      <li><a href="">White crappie</a></li>
		</ul>
	</li>

  <li>Grunts
    <ul>
      <li><a href="">Smallmouth grunt
        </a></li>
      <li><a href="">Burrito</a></li>
      <li><a href="">Pigfish</a></li>
    </ul>
  </li>

  <li>Remoras
    <ul>
      <li><a href="">Whalesucker</a></li>
      <li><a href="">Marlinsucker</a></li>
      <li><a href="">Ceylonese remora</a></li>
      <li><a href="">Spearfish remora</a></li>
      <li><a href="">Slender suckerfish</a></li>
    </ul>
  </li>
</ul>


<style>
ul {
  padding: 0;
  //margin: 0;
  list-style: none;
  }
li{
  float: left;
  //position: relative;
  width: 10em;
  }
 li ul{
  display: none;
  position: absolute; 
  //top: 1em;
  //left: 0;
  }
li > ul {
	//top: auto;
	//left: auto;
	}
li:hover ul, li.over ul { display: block; }
</style>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros