css-偽類元素
阿新 • • 發佈:2018-11-21
一、css偽類元素
a:link{
color:red;/*未訪問的連結*/
}
a:hover{
color:green;/*滑鼠滑過連結*/
}
a:active{
color:pink;/*滑鼠點選的效果*/
}
a:visited{
color:blue;/*訪問過的連結*/
}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>css 偽類元素</title> <style type="text/css"> a:link{ color: red; /*沒有訪問過的連結顏色*/ } a:hover{ color: blue; /*滑鼠在連結上滑動的顏色*/ } a:active{ color:yellow; /*滑鼠點選連結時的顏色*/ } a:visited{ color:green; /*訪問過的連結顏色*/ } </style> </head> <body> <a href="https://www.baidu.com/">百度一下</a><br> </body> </html>