Current location - Recipe Complete Network - Complete cookbook - Problems in creating horizontal drop-down menus using div+css
Problems in creating horizontal drop-down menus using div+css

According to your structure, considering that ie6 does not support the li:hover pseudo-class writing method, I solved it with jQuery.

*{margin:0;padding:0;font-size:14px;line-height:35px;}

a{color:#0099cc;text-decoration:none;}

ul,li{list-style:none;}

#menu{width:800px ;height:35px;background:#333333;}

#menu?ul?li{float:left;width:100px;margin-left:1px;position:relative;}

#menu?ul?li?ul?li{margin-left:0;}

#menu?ul?li?a{width:100%;height:100%;text-align:center ;display:block;background:#666666;}

/*Second-level column*/

#menu?ul?li?ul{display:none;position:absolute;left :0;top:35px;}

#menu?ul?li?ul?a{background:#333333;}

  • First-level column 1
  • First-level column 1
  • First-level column 3

    • Second-level column 1
    • < /p>

    • Second-level column 2
    • Two Level Column 3
    ?

  • First-level column 4

    • Second-level column 4

    • Secondary column 5
    • Secondary column 6
    ?

  • First-level column 5

$(function(){

$("#menu?ul?>?li").hover(function(){

$ (this).find("ul").stop(true,true).show(100);

},function(){

$(this).find( "ul").stop(true,true).hide(100);

})

})