小记:简单的html+css二级导航栏

效果:

导航栏

HTML源码:

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
	<title>nav</title>
</head>
 
<style type="text/css">

    body,ul,li,a {padding: 0;margin: 0;}
    body {background-color:#e6e6e6;color: #fff;}	
    ul li {float: left;display: inline-block;position: relative;width: 60px;line-height: 50px;padding: 0 5px;cursor: pointer;}
    ul li:hover {background-color:#288add;}
    ul li ul li {float: none;}
    ul li ul {position: absolute;left:0;display: none;}
    ul li ul li:hover {background-color: #288add;}
    ul li:hover ul {display: block;background-color:#000;}
	
    .nav {height: 50px;background-color: #000;}
    .navbar {float:right;margin-right:10px;list-style-type: none;} 
    .navbar a {display: block;height: 50px;font-family: "Microsoft Yahei";font-size: 15px;text-align: center;text-decoration: none;color: #fff;}
 
</style>
 
<body>
<div style="width:100%;height:50px">

<div class="nav">
	<ul class="navbar">
		<li class="" ><a href="">首页</a></li>
		<li class="" ><a href="">产品</a>
		  <ul>
            <li><a href="">旗舰产品</a></li>
            <li><a href="">特殊产品</a></li>
          </ul>
		</li>
		<li class="" ><a href="">客户</a></li>
		<li class="" ><a href="">帮助</a></li>
		<li class="" ><a href="">联系我们</a></li>
	</ul>
</div>
</div>
</body>
</html>

 

  • 4
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值