Html
    Css
    Js
* {
	margin:0;
	padding:0;
}
li {
	list-style:none;
}
a {
	text-decoration:none;
}
.nav {
	width:100%;
	position:relative;
}
.nav img {
	position:absolute;
	width:100%;
}
.nav-one {
	width:1060px;
	margin:0 auto;
	position:relative;
	z-index:1;
	height:50px;
	padding-top:10px;
	box-sizing:border-box;
	background-color:rgba(0,0,0,0.4);
}
.nav-one li {
	float:left;
	width:210px;
}
.nav-one li a {
	color:white;
	display:inline-block;
	padding:0px 10px;
	text-align:center;
	width:100%;
	height:30px;
	line-height:30px;
	margin-bottom:10px;
}
.nav-one li .nav-two {
	overflow:hidden;
	background-color:rgba(0,0,0,0.6);
	display:none;
}
.nav-one li .nav-two li {
	float:none;
}
.nav-one li .nav-two li:hover {
	background-color:rgba(0,0,0,0.7);
}
.nav-one li .nav-two li a {
	display:inline-block;
	height:30px;
	line-height:30px;
	padding:0;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:2.0.0
 立即下载

nav水平导航

制作一款水平nav导航栏,可附加多级导航

0