织梦html纯CSS一级栏目下拉导航菜单,找了好久没找到满意的,网上的都是从以前DEDECMS5.5版本扒下来的,还要调用JS.整了半天,很多测试调用不出来,我找的这个上纯CSS,不需要修改其他网站文件,现分享给大家。
效果图:
样式
body{ font:14px "Microsoft YaHei", Arial,Verdana,tahoma, Srial, helvetica, sans-serif; line-height:1.8; color:#333; background:#fff;}
.menu {height: 40px; background: #4ba036;position: relative; z-index:999;
}
.menu a {
text-decoration: none;display: block; padding: 0 12px; margin-right: 1px; line-height: 40px; font-size: 16px; color: #fff;
}
ul {
margin: 0;
padding: 0;
}
.menu li {
list-style: none;
float: left;
width: 90px;
overflow: visible;
cursor: pointer;
}
ul.level0 {
height: 40px;
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: 40px;
line-height: 40px;
text-align: center;
background: #4ba036;
}
ul.level1 > li, ul.level2 > li, ul.level3 > li {
height: 40px;
line-height: 40px;
background: #308a1a;
}
ul.level0 > li:hover {
background: #308a1a;
}
ul.level1 > li:hover, ul.level2 > li:hover, ul.level3 > li:hover {
background: #4ba036;
}
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;
}
调用代码:
喜欢 (1)or分享 (0)