1.链接伪类选择器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> /* 1.给未访问的链接选出来设置样式 a:link */ a:link { color: blue; text-decoration: none; } /* 2.选择点击过的(访问过的)链接 a:visited */ a:visited { color: orange; } /* 3.选择鼠标经过的链接 a:hover */ a:hover { color: skyblue; } /* 4.选择鼠标按下还没有弹起(松开)鼠标的链接 a:active */ a:active { color: red; } </style> </head> <body> <a href="#">小猪佩奇</a> </body> </html>
HTML伪类选择器
最新推荐文章于 2025-03-21 21:08:02 发布