:
active,例如:
a:link{font-weight
:
bold
text-decoration
:
none
color
:
#c00
}
a:visited
{font-weight
:
bold
text-decoration
:
none
color
:
#c30
}
a:hover
{font-weight
:
bold
text-decoration
:
underline
color
:
#f60
}
a:active
{font-weight
:
bold
text-decoration
:
none
color
:
#F90
}
以上语句分别定义了"链接、已访问过的链接、鼠标停在上方时、点下鼠标时"的样式。注意,必须按以上顺序写,否则显示可能和你预想的不一样。记住它们的顺序是“LVHA”。
link链接css文件的方式是通过在html中引用外部css文件来控制样式,在html文件中写入以下引用语句:
<link href="css文件路径" rel="stylesheet" media="screen" />其中href为css文件的路径;
rel="stylesheet"表示此链接文件是文档的外部样式表;
media="screen"表示被链接文档应用在计算机屏幕上,这也是默认值。