纯CSS+XHTML完成的2级导航栏菜单实际效果

日期:2021-01-20 类型:科技新闻 

关键词:网页设计,移动端网页设计,大一网页设计作业成品,网页编辑软件,网页在线编辑

本文案例讲述了纯CSS+XHTML完成的2级导航栏菜单实际效果。共享给大伙儿供大伙儿参照。实际以下:

这是1款简洁、适配好的XHTML+css2级导航栏菜单

运作实际效果截图以下:

线上演试详细地址以下:

http://demo.jb51.net/js/2015/css-xhtml⑵l-menu-nav-demo-codes/

实际编码以下:


拷贝编码
编码以下:

<!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=utf⑻" />
<title>纯CSS+XHTML往下拉菜单</title>
<style type="text/css">
<!--
* {
margin:0;
padding:0;
}
body {
font:12px Verdana, Geneva, sans-serif #333;
line-height:1.5;
}
ul li {
list-style:none;
}
.menu {
width:660px;
margin:20px auto;
}
.menu li {
display:inline;
float:left;
margin:0 5px;
background:#f2f2f2;
border:1px #39c solid;
text-align:center;
font-size:14px;
font-weight:700;
line-height:30px;
cursor:hand;
}
.tuckUp {
display:inline;
width:120px;
height:30px;
overflow:hidden;
background:#f2f2f2;
}
.pullDown{
display:inline;
height:auto;
}
.item a:link, .item a:visited {
display:inline;
float:left;
width:110px;
background:#ccc;
text-align:center;
color:#444;
font-size:12px;
font-weight:normal;
text-decoration:none;
line-height:25px;
margin:0 5px 5px 5px;
}
.item a:hover {
display:inline;
float:left;
background:#39c;
width:100px;
color:#FFF;
text-decoration:none;
text-align:center;
font-size:12px;
font-weight:700;
font-weight:normal;
line-height:25px;
padding:0 0 0 10px;
margin:0 5px 5px 5px;
}
//
-->
</style>
</head>
<body>
<ul class="menu">
<li class="tuckUp" onmousemove="this.className='pullDown'" onmouseout="this.className='tuckUp'">精品殊效
<div class="item"><a href="#">网页页面殊效</a></a>
<a href="#">层和合理布局</a></a>
<a href="#">表单按钮</a>
</div>
</li>
<li class="tuckUp" onmouseover="this.className='pUllDown'" onmouseout="this.className='tuckUp'">菜单导航栏
<div class="item"><a href="#">菜单导航栏</a>
<a href="#">CSS菜单</a>
<a href="#">JQUERY菜单</a>
</div>
</li>
<li class="tuckUp" onmouseover="this.className='pullDown'" onmouseout="this.className='tuckUp'">源码
<div class="item" ><a href="#">源代码免费下载</a>
<a href="#">ASP归类</a>
<a href="#">PHP归类</a>
<a href="#">ASP.NET</a>
</div>
</li>
<li class="tuckUp" onmouseover="this.className='pUllDown'" onmouseout="this.className='tuckUp'">升级汇总
<div class="item"><a href="#">全新升级</a>
<a href="#">全新升级</a>
<a href="#">网站主页</a>
</div>
</li>
<li class="tuckUp" onmouseover="this.className='pUllDown'" onmouseout="this.className='tuckUp'">脚本制作免费下载
<div class="item"><a href="#">脚本制作資源</a>
<a href="#">AJAX</a>
<a href="#">JQUERY</a>
<a href="#">EXTJS</a>
</div>
</li>
</ul>
</body>
</html>

期待本文所述对大伙儿的CSS网页页面设计方案有一定的协助。