简单实现css下拉导航布局样式

Original 2019-01-19 14:38:58 252
abstract:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>网站导航下拉菜单</title><style>body{margin: 0px;padding: 0px;}.nav{width:100%;ba

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>网站导航下拉菜单</title>

<style>

body{margin: 0px;padding: 0px;}

.nav{width:100%;background: #2c73fa;height: 40px;}

.header{width: 1000px;margin: 0px auto;}

.header ul{margin: 0px;padding: 0px;list-style: none;}

.header ul li{width:200px; height: 40px;line-height:40px; float: left;text-align: center;}

.header ul li:hover{background:#f60;}

.header ul li a{color:#fff;text-decoration:none;font-size:16px;}

.header .nav1{width:200px; border:1px solid  #ddd;overflow: hidden;}

.header .nav1{display:none;position: relative;}

.header ul li:hover .nav1{display: block;position: absolute;}

.header .nav1 li{border-bottom:1px dashed #ddd;}

</style>

</head>

<body>

<div class="nav">

<div class="header">

<ul>

<li><a href="#">首页</a></li>

<li><a href="#">关于我们</a>

<ul class="nav1">

<li>企业简介</li>

<li>组织架构</li>

<li>企业文化</li>

<li>服务网点</li>

</ul>

</li>

<li><a href="#">产品中心</a>

<ul class="nav1">

<li>电脑</li>

<li>手机</li>

<li>充电器</li>

<li>数据线</li>

</ul>

</li>

<li><a href="#">在线留言</a></li>

<li><a href="#">联系我们</a>

</li>

</ul>

</div>

</div>

</body>

</html>


Correcting teacher:灭绝师太Correction time:2019-01-19 14:41:41
Teacher's summary:还可以添加布局样式,字体库,边框等,多多练习,继续加油!

Release Notes

Popular Entries