请教“CSS3实现隐藏与显示切换效果原型”
1个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<style type="text/css">
li{list-style: none;}
a{text-decoration: none!important;color: #fff;}
.clearfix:after{
content: "";
display: block;
clear: both;
}
.clearfix{
zoom:1;
}
.nav li {
float: left;
width: 150px;
background: orange;
height: 40px;
text-align: center;
line-height: 40px;
font-family: "微软雅黑";
position: relative;
}
.nav > ul > li:hover {
display: inline-block;
transition: all 0.5s ease;
background: #E9840C;
}
.nav .subNav {
position: absolute;
right: 0;
display: none;
}
.nav .subNav li {
background: #217CCB;
}
.nav > ul > li:hover .subNav {
display: block;
}
</style>
<body>
<div class="nav">
<ul class="clearfix">
<li>
<a href="#">首页</a>
</li>
<li>
<a href="#">组织机构</a>
<div class="subNav">
<ul>
<li><a href="#">信用积分</a></li>
<li><a href="#">实时查询</a></li>
</ul>
</div>
</li>
</ul>
</div>
</body>
</html>
复制到你的html文件里,在浏览器运行看看是不是说的这种纯css实现的显示隐藏的效果。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询