Jump to content

Nav with several levels


son

Recommended Posts

I have a top nav where you only see items from next level if you hover over li item of main list. The css is:

#navItems {margin:25px 0;}#navItems ul {float:right; margin-left:15px;}#navItems ul li {float:left; position:relative;}#navItems ul li a {display:block;padding:3px;}#navItems li ul {display: none; margin:0;}#navItems li:hover ul {position: absolute;display:inline; left:0;}#navItems ul li ul li {width:340px;}

Initially I did not have:#navItems ul li ul li {width:340px;}but I added the width as text broke down in several rows if main list item narrower than sub-item. Now, I find that sometimes 340px does not work well and I would like to have the sub-items' width adjust to the relevant text lenght (that could be less, equal or more than main item. How can I achieve this? Also, is there a way to have more sub-levels with same hovering over parent item to show sub-items? I added another sub-level (level 3), but could not make it work... Son

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...