首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

css上拉菜单

2012-10-09 
css下拉菜单#header {position: relativewidth: 100%font: 12px normal Arial, Helvetica, sans-serifz

css下拉菜单
#header {
position: relative;
width: 100%;
font: 12px normal Arial, Helvetica, sans-serif;
    z-index:1;
}

#header .disclaimer a {
color: #ccc;
}

#header img {
/*margin: 20px 0 10px;*/
}

ul.topnav {
list-style: none;
padding: 0 20px 0 20px;
margin: 0px;
float: left;
    width:96%;
font-size: 1.2em;
background: url(/resources/images/topnav_bg.gif) repeat-x;
}

ul.topnav li {
float: left;
margin: 0;
padding: 0 15px 0 0;
position: relative; /*--Declare X and Y axis base--*/
}

ul.topnav li a {
padding: 10px 5px;
color: #fff;
display: block;
text-decoration: none;
float: left;
}

ul.topnav li a:hover {
/*background: url(topnav_hover.gif) no-repeat center top;*/
}

ul.topnav li span {
width: 17px;
height: 35px;
float: left;
background: url(/resources/images/subnav_btn.gif) no-repeat center top;
}

ul.topnav li span.subhover {
background-position: center bottom;
cursor: pointer;
}

/*--Hover effect for trigger--*/
ul.topnav li ul.subnav {
list-style: none;
position: absolute; /*--Important - Keeps subnav from affecting main navigation flow--*/
left: 0;
top: 35px;
background: #336699;
margin-top: -4px;
padding: 0;
display: none;
float: left;
width: 170px;
border-left: 1px solid #4682b4; /*--Create bevel effect--*/
border-right: 1px solid #4682b4; /*--Create bevel effect--*/
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
}

ul.topnav li ul.subnav li {
margin: 0;
padding: 0;
border-bottom: 1px solid #4682b4; /*--Create bevel effect--*/
clear: both;
width: 170px;
}

html ul.topnav li ul.subnav li a {
float: left;
width: 145px;
background: #6490bb no-repeat 10px center;
padding-left: 20px;
}

html ul.topnav li ul.subnav li a:hover {
/*--Hover effect for subnav links--*/
background: #C9C9A7 no-repeat 10px center;
color: black;
}
<div id="header">
    <ul class="wrapper">

热点排行