很漂亮很有個(gè)性的css水平下拉菜單
來源:易賢網(wǎng) 閱讀:944 次 日期:2016-06-23 08:54:20
溫馨提示:易賢網(wǎng)小編為您整理了“很漂亮很有個(gè)性的css水平下拉菜單”,方便廣大網(wǎng)友查閱!

代碼如下:

<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en http://m.bwnwqq.cn/tr/xhtml1/dtd/xhtml1-transitional.dtd>

<html xmlns=http://m.bwnwqq.cn/1999/xhtml>

<head>

<meta http-equiv=content-type content=text/html; charset=utf-8 />

<title>css menu - horizontal</title>

<style type=text/css>

<!--

@importdhtml-horiz.css;

-->

body {

margin: 0;

padding: 30px;

background: #fff;

color: #666;

}

h1 {

font: bold 16px arial, helvetica, sans-serif;

}

p {

font: 11px arial, helvetica, sans-serif;

}

a {

color: #900;

text-decoration: none;

}

a:hover {

background: #900;

color: #fff;

}

/*css code for menu begin:*/

/* root = horizontal, secondary = vertical */

ul#navmenu {

margin: 0;

border: 0 none;

padding: 0;

width: 500px; /*for khtml*/

list-style: none;

height: 24px;

}

ul#navmenu li {

margin: 0;

border: 0 none;

padding: 0;

float: left; /*for gecko*/

display: inline;

list-style: none;

position: relative;

height: 24px;

}

ul#navmenu ul {

margin: 0;

border: 0 none;

padding: 0;

width: 160px;

list-style: none;

display: none;

position: absolute;

top: 24px;

left: 0;

}

ul#navmenu ul li {

float: none; /*for gecko*/

display: block !important;

display: inline; /*for ie*/

}

/* root menu */

ul#navmenu a {

border: 1px solid #fff;

border-right-color: #ccc;

border-bottom-color: #ccc;

padding: 0 6px;

float: none !important; /*for opera*/

float: left; /*for ie*/

display: block;

background: #eee;

color: #666;

font: bold 10px/22px verdana, arial, helvetica, sans-serif;

text-decoration: none;

height: auto !important;

height: 1%; /*for ie*/

}

/* root menu hover persistence */

ul#navmenu a:hover,

ul#navmenu li:hover a,

ul#navmenu li.iehover a {

background: #ccc;

color: #fff;

}

/* 2nd menu */

ul#navmenu li:hover li a,

ul#navmenu li.iehover li a {

float: none;

background: #eee;

color: #666;

}

/* 2nd menu hover persistence */

ul#navmenu li:hover li a:hover,

ul#navmenu li:hover li:hover a,

ul#navmenu li.iehover li a:hover,

ul#navmenu li.iehover li.iehover a {

background: #ccc;

color: #fff;

}

/* 3rd menu */

ul#navmenu li:hover li:hover li a,

ul#navmenu li.iehover li.iehover li a {

background: #eee;

color: #666;

}

/* 3rd menu hover persistence */

ul#navmenu li:hover li:hover li a:hover,

ul#navmenu li:hover li:hover li:hover a,

ul#navmenu li.iehover li.iehover li a:hover,

ul#navmenu li.iehover li.iehover li.iehover a {

background: #ccc;

color: #fff;

}

/* 4th menu */

ul#navmenu li:hover li:hover li:hover li a,

ul#navmenu li.iehover li.iehover li.iehover li a {

background: #eee;

color: #666;

}

/* 4th menu hover */

ul#navmenu li:hover li:hover li:hover li a:hover,

ul#navmenu li.iehover li.iehover li.iehover li a:hover {

background: #ccc;

color: #fff;

}

ul#navmenu ul ul,

ul#navmenu ul ul ul {

display: none;

position: absolute;

top: 0;

left: 160px;

}

/* do not move - must come before display:block for gecko */

ul#navmenu li:hover ul ul,

ul#navmenu li:hover ul ul ul,

ul#navmenu li.iehover ul ul,

ul#navmenu li.iehover ul ul ul {

display: none;

}

ul#navmenu li:hover ul,

ul#navmenu ul li:hover ul,

ul#navmenu ul ul li:hover ul,

ul#navmenu li.iehover ul,

ul#navmenu ul li.iehover ul,

ul#navmenu ul ul li.iehover ul {

display: block;

}

</style>

<script type=text/javascript>

navhover = function() {

var lis = document.getelementbyid(navmenu).getelementsbytagname(li);

for (var i=0; i<lis.length; i++) {

lis[i].onmouseover=function() {

this.classname+= iehover;

}

lis[i].onmouseout=function() {

this.classname=this.classname.replace(new regexp( iehover\\b), );

}

}

}

if (window.attachevent) window.attachevent(onload, navhover);

</script>

</head>

<body>

<h1>css menu - horizontal</h1>

<hr />

<ul id=navmenu>

<li><a href=#>blog</a></li>

<li><a href=#>work +</a>

<ul>

<li><a href=#>websites +</a>

<ul>

<li><a href=#>qrayg</a></li>

<li><a href=#>qarcade</a></li>

<li><a href=#>qlom</a></li>

<li><a href=#>qdt</a></li>

</ul>

</li>

<li><a href=#>pen and ink</a></li>

<li><a href=#>free interfaces</a></li>

</ul>

</li>

<li><a href=#>learn +</a>

<ul>

<li><a href=#>fireworks +</a>

<ul>

<li><a href=#>aquabutton</a></li>

<li><a href=#>aquabutton2</a></li>

<li><a href=#>waterdrop</a></li>

<li><a href=#>lightfx</a></li>

<li><a href=#>lightfx2</a></li>

</ul>

</li>

<li><a href=#>css +</a>

<ul>

<li><a href=#>footerstick</a></li>

<li><a href=#>spritenav</a></li>

<li><a href=#>@import</a></li>

</ul>

</li>

</ul>

</li>

<li><a href=#>info</a></li>

<li><a href=#>contact</a></li>

</ul>

</body>

</html>

更多信息請(qǐng)查看網(wǎng)頁制作
易賢網(wǎng)手機(jī)網(wǎng)站地址:很漂亮很有個(gè)性的css水平下拉菜單
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國考·省考課程試聽報(bào)名

  • 報(bào)班類型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專用圖標(biāo)