1 <head> 2 <meta charset="utf-8"> 3 <title>a标签的伪类别属性</title> 4 <style type="text/css"> 5 #sss{ 6 font-size: 20px; 7 font-family: Lucida; 8 background-color: #16C425; 9 width: 60px; 10 height: auto; 11 } 12 #sss ul{ 13 border: solid 4px #897623; 14 list-style-type: none; 15 padding: 0px; 16 } 17 #sss ul li{ 18 border-bottom: dotted 2px #123321; 19 } 20 #sss ul li a{ 21 display: block; 22 width: 50px; 23 height: 30px; 24 border-left: #F75638 5px solid; 25 } 26 a:link{ 27 color: darkred; 28 text-decoration: none; 29 } 30 a:hover{ 31 background: #270B60; 32 color: darkmagenta; 33 text-decoration: underline; 34 } 35 a:active{ 36 background: #C70037; 37 color:#000000; 38 text-decoration: line-through; 39 } 40 a:visited{ 41 color:#ffffff; 42 text-decoration: overline; 43 } 44 </style> 45 </head> 46 47 <body> 48 <div id="sss"> 49 <ul> 50 <li><a href="#">首页</a></li> 51 <li><a href="#">朋友</a></li> 52 <li><a href="#">空间</a></li> 53 <li><a href="#">微博</a></li> 54 </ul> 55 </div> 56 57 </body>
可通过display属性的block值将a行级标签转换为块级标签