下拉菜单

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}

ul {
list-style: none;
}

.wrap {
330px;
height: 30px;
margin: 100px auto 0;
padding-left: 10px;
background-image: url(images/bg.jpg);
}

.wrap li{
background-image: url(images/libg.jpg);
}

.wrap > ul > li {
float: left;
margin-right: 10px;
position: relative;
}

.wrap a {
display: block;
height: 30px;
100px;
text-decoration: none;
color: #000;
line-height: 30px;
text-align: center;
}

.wrap li ul {
position: absolute;
top: 30px;
display: none;
}

</style>
<script src="jquery-1.12.2.js"></script>
<script>
$(function(){
  $(".wrap>ul>li").mouseover(function(){
    $(this).children("ul").stop().show(500);
  });
  $(".wrap>ul>li").mouseout(function(){
    $(this).children("ul").stop().hide(500);
  });
});
</script>
</head>
<body>
<div class="wrap">
<ul>
<li>
<a href="javascript:void(0);">帅哥系列</a>
<ul>
<li><a href="javascript:void(0);">乔峰</a></li>
<li><a href="javascript:void(0);">张无忌</a></li>
<li><a href="javascript:void(0);">郭靖</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>

原文地址:https://www.cnblogs.com/pxxdbk/p/12662449.html