南强小屋 Design By 杰米
代码中还没有添加注释,不过不难理解。注释稍后添加。
以下是代码:
复制代码代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
body {
font-family:"宋体";
font-size:12px;
}
.menu {
height:30px;
background:#e6e6e6;
margin-left:10px;
}
.menu a {
text-decoration:none;
}
ul {
margin:0;
padding:0;
}
.menu li {
list-style:none;
float:left;
width:90px;
overflow:visible;
cursor:pointer;
}
ul.level0 {
height:30px;
overflow:visible;
}
ul.level1, ul.level2, ul.level3 {
width:90px;
display:none;
}
ul.level2, ul.level3 {
margin:-28px 0 0 90px;
}
ul.level0 > li {
height:30px;
line-height:30px;
text-align:center;
background:#999;
}
ul.level1 > li, ul.level2 > li, ul.level3 > li {
height:28px;
line-height:28px;
background:#bbb;
}
ul.level0 > li:hover {
background:#ccc;
}
ul.level1 > li:hover, ul.level2 > li:hover, ul.level3 > li:hover {
background:#ddd;
}
ul.level0 > li.imyeah:hover > ul, ul.level1 > li.imyeah:hover > ul, ul.level2 > li.imyeah:hover > ul, ul.level3 > li.imyeah:hover > ul {
display:block;
}
</style>
</head>
<body>
<div class="menu">
<ul class="level0">
<li class="imyeah"> <a href="#">immenu0</a>
<ul class="level1">
<li> <a href="#">imdropmenu00</a> </li>
<li class="imyeah"> <a href="#">imdropmenu01</a>
<ul class="level2">
<li class="imyeah"> <a href="#">imdropmenu010</a>
<ul class="level3">
<li> <a href="#">imdropmenu0100</a> </li>
<li> <a href="#">imdropmenu0101</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu011</a> </li>
<li> <a href="#">imdropmenu012</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu02</a> </li>
<li> <a href="#">imdropmenu03</a> </li>
<li> <a href="#">imdropmenu04</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu1</a>
<ul class="level1">
<li class="imyeah"> <a href="#">imdropmenu10</a>
<ul class="level2">
<li> <a href="#">imdropmenu100</a> </li>
<li class="imyeah"> <a href="#">imdropmenu101</a>
<ul class="level3">
<li> <a href="#">imdropmenu1010</a> </li>
<li> <a href="#">imdropmenu1011</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu102</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu11</a> </li>
<li> <a href="#">imdropmenu12</a> </li>
<li> <a href="#">imdropmenu13</a> </li>
<li> <a href="#">imdropmenu14</a> </li>
<li> <a href="#">imdropmenu15</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu2</a>
<ul class="level1">
<li> <a href="#">imdropmenu20</a> </li>
<li> <a href="#">imdropmenu21</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu3</a>
<ul class="level1">
<li> <a href="#">imdropmenu30</a> </li>
<li> <a href="#">imdropmenu31</a> </li>
<li> <a href="#">imdropmenu32</a> </li>
</ul>
</li>
<li> <a href="#" class="top_link">immenu4</a> </li>
</ul>
</div>
</body>
</html>
以下是代码:
复制代码代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
body {
font-family:"宋体";
font-size:12px;
}
.menu {
height:30px;
background:#e6e6e6;
margin-left:10px;
}
.menu a {
text-decoration:none;
}
ul {
margin:0;
padding:0;
}
.menu li {
list-style:none;
float:left;
width:90px;
overflow:visible;
cursor:pointer;
}
ul.level0 {
height:30px;
overflow:visible;
}
ul.level1, ul.level2, ul.level3 {
width:90px;
display:none;
}
ul.level2, ul.level3 {
margin:-28px 0 0 90px;
}
ul.level0 > li {
height:30px;
line-height:30px;
text-align:center;
background:#999;
}
ul.level1 > li, ul.level2 > li, ul.level3 > li {
height:28px;
line-height:28px;
background:#bbb;
}
ul.level0 > li:hover {
background:#ccc;
}
ul.level1 > li:hover, ul.level2 > li:hover, ul.level3 > li:hover {
background:#ddd;
}
ul.level0 > li.imyeah:hover > ul, ul.level1 > li.imyeah:hover > ul, ul.level2 > li.imyeah:hover > ul, ul.level3 > li.imyeah:hover > ul {
display:block;
}
</style>
</head>
<body>
<div class="menu">
<ul class="level0">
<li class="imyeah"> <a href="#">immenu0</a>
<ul class="level1">
<li> <a href="#">imdropmenu00</a> </li>
<li class="imyeah"> <a href="#">imdropmenu01</a>
<ul class="level2">
<li class="imyeah"> <a href="#">imdropmenu010</a>
<ul class="level3">
<li> <a href="#">imdropmenu0100</a> </li>
<li> <a href="#">imdropmenu0101</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu011</a> </li>
<li> <a href="#">imdropmenu012</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu02</a> </li>
<li> <a href="#">imdropmenu03</a> </li>
<li> <a href="#">imdropmenu04</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu1</a>
<ul class="level1">
<li class="imyeah"> <a href="#">imdropmenu10</a>
<ul class="level2">
<li> <a href="#">imdropmenu100</a> </li>
<li class="imyeah"> <a href="#">imdropmenu101</a>
<ul class="level3">
<li> <a href="#">imdropmenu1010</a> </li>
<li> <a href="#">imdropmenu1011</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu102</a> </li>
</ul>
</li>
<li> <a href="#">imdropmenu11</a> </li>
<li> <a href="#">imdropmenu12</a> </li>
<li> <a href="#">imdropmenu13</a> </li>
<li> <a href="#">imdropmenu14</a> </li>
<li> <a href="#">imdropmenu15</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu2</a>
<ul class="level1">
<li> <a href="#">imdropmenu20</a> </li>
<li> <a href="#">imdropmenu21</a> </li>
</ul>
</li>
<li class="imyeah"> <a href="#" class="top_link">immenu3</a>
<ul class="level1">
<li> <a href="#">imdropmenu30</a> </li>
<li> <a href="#">imdropmenu31</a> </li>
<li> <a href="#">imdropmenu32</a> </li>
</ul>
</li>
<li> <a href="#" class="top_link">immenu4</a> </li>
</ul>
</div>
</body>
</html>
效果图如下:
标签:
css,下拉菜单
南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米
暂无很实用的 轻量纯css多级下拉菜单的评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。