CSS 循序渐进(四)表里春秋
这一次还是继续为大家介绍一些样式表应用方面的技巧。大家知道样式表的定义是针对容器(tag)而言的,那么在html 中,anchor(锚,即超级链接标记)是一类作用非常之大的容器。它实现了html最根本的功能(超文本,超链接)。而css也有关于anchor的一些特殊用法。使得页面的联接更紧凑,更富有条理。
跟其它的tag一样,anchor的定义方法也可以是:
a:{css标记}
可是它特殊之处在于,它有各种相关的属性,比如visited(浏览过),active(激活),hover(鼠标在其上),link(有链接)。可以根据不同需要而做出专门的定义以根据用户不同的动作做出反应,从而形成比较好的效果。
比如说,您可以做以下的定义:
< html>
< head>
< title>untitled document< /title>
< meta http-equiv="content-type" content="text/html; charset=gb2312">
< style type="text/css">
< !-- a:active { font-family: "宋体"; font-size: 9pt; color: #9999ff; text-decoration: underline}a:hover { font-family: "宋体"; font-size: 9pt; color: #99ff99; text-decoration: underline}a:link { font-family: "宋体"; font-size: 9pt; color: #ffcccc; text-decoration: none}-->
< /style>
< /head>
< body bgcolor="#000000">
< a href="www.www.www">返回< /a>
< /body>
< /html>
