Friday, 15 April 2011

Sub menu items past 2nd or 3rd item on a css menu disappears -



Sub menu items past 2nd or 3rd item on a css menu disappears -

sub menu items past 2nd or 3rd item on css menu disappear.. not sure i'm doing wrong.. have looked @ several "fixes" problem none i've seen seems prepare or i've been awake long.. below i'm trying use.. help on appreciated..

#nav{ list-style:none; font-weight:bold; margin-bottom:10px; /* clear floats */ float:left; width:100%; bring nav above else position:relative; z-index:5; } #nav li{ float:left; margin-right:10px; position:relative; } #nav a{ display:block; padding:0px; color:#03045f; text-decoration:none; } #nav a:hover{ color:#bf120b; background:#c3dbed; text-decoration:underline; } /*--- dropdown ---*/ #nav ul{ background:#bf120b; /* adding background makes dropdown work in ie7+. create close page's background possible (i.e. white page == white background). */ background:rgba(255,255,255,0); /* but! let's create background transparent can, don't want see if can help it... */ list-style:none; position:absolute; left:-9999px; /* hide off-screen when not needed (this more accessible display:none;) */ } #nav ul li{ padding-top:-5px; /* introducing padding between li , give illusion spaced items */ float:none; } #nav ul a{ white-space:wrap; /* stop text wrapping , creating multi-line dropdown items */ } #nav li:hover ul{ /* display dropdown on hover */ left:0; /* bring on-screen when needed */ } #nav li:hover a{ /* these create persistent hover states, meaning top-most link stays 'hovered' when cursor has moved downwards list. */ background:#eef5fb; text-decoration:underline; } #nav li:hover ul a{ /* persistent hover state create global style links before they're hovered. here undo these effects. */ text-decoration:none; } #nav li:hover ul li a:hover{ /* here define explicit hover states--what happens when hover each individual link. */ background:#c3dbed; } <ul id="nav"> <li> <a href="" title="return home">home</a> </li> <li> <a href="#" title="whats on">on air</a> <ul> <li><a href="">schedule</a></li> <li><a href="">syndicated</a></li> <li><a href="">talent</a></li> </ul> </li> <li> <a href="#" title="how to">how</a> <ul> <li><a href="">requests</a></li> <li><a href="">info</a></li> <li><a href="">ltd</a></li> </ul> </li> <li> <a href="#" title=" presence on web">social</a> <ul> <li><a href="">chat</a></li> <li><a href="">facebook</a></li> <li><a href="">twitter</a></li> <li><a href="">friends</a></li> <li><a href="">nugget shack</a></li> </ul> </li> <li> <a href="#" title="get in touch">contact</a> <ul> <li><a href="">contact us</a></li> <li><a href="">directions</a></li> </ul> </li> </ul>

fiddle: http://jsfiddle.net/rybqc/

css

No comments:

Post a Comment