标签:style blog io ar color os sp on div
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Document</title> 6 <style> 7 ul{padding: 0;margin: 0;background-color: #f26e6e;border: 1px solid #000;width: 80px;color: #000;line-height: 2em;position: absolute;} 8 #blc{line-height: 2em;background-color: #eeff90;text-align: center;border: 1px solid #000;display: none} 9 a{text-decoration: none;color: #000} 10 li{list-style: none;} 11 ul ul a:hover{background-color: yellow;display: block} 12 p{position: relative;top: 6em} 13 /* 14 1.display:none;显示为无 15 2.visibility:hidden;隐藏 16 3.width height 17 4,透明度 18 19 */ 20 </style> 21 </head> 22 <body> 23 <p>sws</p> 24 <ul id=‘link‘> 25 <li><a href="#">微博</a></li> 26 <ul id=‘blc‘> 27 <li><a href="#">评论</a></li> 28 <li><a href="#">私信</a></li> 29 <li><a href="#">@我</a></li> 30 </ul> 31 </ul> 32 33 <script> 34 function toogle(){ 35 var link=document.getElementById(‘link‘); 36 var blc=document.getElementById(‘blc‘); 37 link.onmouseover=function(){ 38 blc.style.display=‘block‘; 39 40 }; 41 link.onmouseout=function(){ 42 blc.style.display=‘none‘; 43 } 44 } 45 toogle(); 46 </script> 47 </body> 48 </html>
标签:style blog io ar color os sp on div
原文地址:http://www.cnblogs.com/xiaqi/p/4163043.html