设置完a:link的样式后,下面分别设置a:visited ,a:hover ,a:active的样式
生成的源代码如下:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <style type="text/css">
- a:link { color: #06F; text-decoration: none; }
- a:visited { color: #999; text-decoration: line-through; }
- a:hover { color: #F00; text-decoration: underline; }
- a:active { color: #F0F; }
- </style>
- </head>
- <body>
- <p><a href="#">这里是链接</a></p>
- <p><a href="10.html">这里也是链接</a></p>
- </body>
- </html>
注意:四种状态的顺序一定不能颠倒,否则有些不生效