纯CSS完成的菜单,鼠标滑过菜单项时,菜单项会变年夜并带有暗影成果
正在网页<head>区增加款式界说
[code]
<style type="text/css">
#container {width:680px; height:230px; padding:20px 0 0 50px; background:url(bears.jpg); border:1px solid #000;}
#large {padding:0; margin:0; list-style:none;}
#large li {float:left; display:block; margin-right:5px; width:100px; height:25px;}
#large li a {display:inline; float:left; width:100px; height:25px; position:absolute; text-align:center; text-decoration:none;}
#large li a em {display:block; width:100px; height:25px; background:#874; border:1px solid #fff;}
#large li a b {display:block; width:100px; height:25px; background:transparent; color:#dd7; position:absolute; top:0; left:0; line-height:24px;}
#large li a:hover {white-space:normal; cursor:pointer; z-index:100;}
#large li a:hover em {display:block; width:115px; height:35px; left:7px; top:5px; position:absolute; background:#431; z-index:100; opacity:0.7; border:0}
#large li a:hover b {width:110px; height:30px; top:-7px; left:-5px; z-index:200; background:#985; font-size:1.1em; color:#ff9; line-height:29px; border:1px solid #fff;}
</style>
<!--[if lte IE 6]>
<style type="text/css">
#large li a:hover em {filter: alpha(opacity=70); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);}
</style>
<![endif]-->
[/code]
正在网页<body>区增加HTML代码
[code]
<div id="container">
<ul id="large">
<li><a href="//www.sharejs.com"><em></em><b>Home</b></a></li>
<li><a href="#nogo"><em></em><b>Mama Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Papa Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Baby Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Goldilocks</b></a></li>
<li><a href="#nogo"><em></em><b>Porridge</b></a></li>
</ul>
</div>
[/code]
正在网页<head>区增加款式界说
[code]
<style type="text/css">
#container {width:680px; height:230px; padding:20px 0 0 50px; background:url(bears.jpg); border:1px solid #000;}
#large {padding:0; margin:0; list-style:none;}
#large li {float:left; display:block; margin-right:5px; width:100px; height:25px;}
#large li a {display:inline; float:left; width:100px; height:25px; position:absolute; text-align:center; text-decoration:none;}
#large li a em {display:block; width:100px; height:25px; background:#874; border:1px solid #fff;}
#large li a b {display:block; width:100px; height:25px; background:transparent; color:#dd7; position:absolute; top:0; left:0; line-height:24px;}
#large li a:hover {white-space:normal; cursor:pointer; z-index:100;}
#large li a:hover em {display:block; width:115px; height:35px; left:7px; top:5px; position:absolute; background:#431; z-index:100; opacity:0.7; border:0}
#large li a:hover b {width:110px; height:30px; top:-7px; left:-5px; z-index:200; background:#985; font-size:1.1em; color:#ff9; line-height:29px; border:1px solid #fff;}
</style>
<!--[if lte IE 6]>
<style type="text/css">
#large li a:hover em {filter: alpha(opacity=70); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);}
</style>
<![endif]-->
[/code]
正在网页<body>区增加HTML代码
[code]
<div id="container">
<ul id="large">
<li><a href="//www.sharejs.com"><em></em><b>Home</b></a></li>
<li><a href="#nogo"><em></em><b>Mama Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Papa Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Baby Bear</b></a></li>
<li><a href="#nogo"><em></em><b>Goldilocks</b></a></li>
<li><a href="#nogo"><em></em><b>Porridge</b></a></li>
</ul>
</div>
[/code]
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。