CSS实现鼠标滑过带放大效果的菜单 |
2021-01-21 22:05:14 35资源网(www.35d.net) |
js |
下载本资源原文网址:http://www.daima.org/js/js13399.html 纯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] |
|
|
|
资源大全_资源下载网站:www.35d.net 本站资源仅限研究学习使用,如需商用请联系版权方, 本站事务联系QQ:939804642
|
|