css菜单演示效果截图,如下:
css+xhtml制作的一款简单菜单
1,css代码部分
复制代码 代码示例:
<style type="text/css">
<!--
* {
margin:0;
padding:0;
}
body {
font:12px Verdana, Geneva, sans-serif #444;
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:140px;
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>
2,html代码部分(css下拉菜单)
复制代码 代码示例:
<ul class="menu">
<li class="tuckUp" onmousemove="this.className='pullDown'"
onmouseout="this.className='tuckUp'">www.yuju100.com
<div class="item"><a href="http://www.yuju100.com">ITEM01</a><br />
<a href="http://www.yuju100.com">ITEM02</a></a><br />
<a href="http://www.yuju100.com">ITEM03</a><br />
<a href="http://www.yuju100.com">ITEM04</a><br />
<a href="http://www.yuju100.com">ITEM05</a><br />
<a href="http://www.yuju100.com">ITEM06</a><br /></div>
</li>
<li class="tuckUp" onmouseover="this.className='pUllDown'"
onmouseout="this.className='tuckUp'">MenuTwo
<div class="item"><a href="http://www.yuju100.com">ITEM01</a><br />
<a href="http://www.yuju100.com">ITEM02</a><br />
<a href="http://www.yuju100.com">ITEM03</a><br />
<a href="http://www.yuju100.com">ITEM04</a><br /></div>
</li>
</ul>