CSS伪类样式(less父级选择器&)

html-css07

CSS伪类样式(less父级选择器&),第1张

link是未访问的时候,visited是已访问的时候,hover是鼠标移动到链接上时,active选定的时候

提示:在 CSS 定义中,a:hover 必须被置于 a:link 和 a:visited 之后,才是有效的。

提示:在 CSS 定义中,a:active 必须被置于 a:hover 之后,才是有效的。

同样使用less样式

CSS中用四个伪类来定义链接的样式,分别是:a:link、a:visited、a:hover和a : 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”。