Untitled Document body{ color: black; } .father{ height: 31px; background-color: grey; position: relative; } .father li{ float: left; margin-right: 5px; } .son{ display: none; background-color: red; height: 30px; top: 31px; left: 0px; } .father li:hover ul{ display: block; } .son li{ float: left; margin-right: 5px; } first father son1 son1 son1
这是我的代码 但是在chrome和ie下不一样 哪位大牛帮忙解决一下 谢谢
回复讨论(解决方案)
初步帮楼主整理了下,IE7+和谷歌差不多,一般直接CSS样式控制的横向下拉菜单不是很好,最好是通过JS来控制,希望对楼主有所帮助。
横向菜单 .horizontallyMenu{ padding: 10px; border: 1px solid red; } .father{ height: 31px; position: relative; list-style: none; margin: 0px; padding: 0px; } .father li{ cursor: pointer; float: left; padding: 5px; margin-right: 5px; } .father li a{ text-decoration: none; } .father li:hover ul{ display: block; } .son{ display: none; background-color: red; height: 30px; list-style: none; margin: 0px; padding: 0px; margin-top: 5px; } .son li{ cursor: pointer; padding: 5px; float: left; margin-right: 5px; } .son li:hover{ background-color: blue; }first father son1 son1 son1
查看更多关于css实现横向下拉菜单_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did103742