伪类选择器
📅 2026/7/28 18:29:51
👁️ 阅读次数
📝 编程学习
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> /*设置顺序: l v h a*/ a{ font-size: 30px; } /*当超链接正常情况下的样式*/ a:link{ text-decoration: none; color: red; font-size: 20px; } /*当鼠标移开超链接的时候的样式*/ a:visited{ /*浏览器对它进行限制,只能修改颜色*/ color: blue; } /*当鼠标滑入的时候的样式*/ a:hover{ text-decoration: overline; color: yellow; font-size: 30px; } /*当鼠标按下去不松开的时候的样式*/ a:active{ text-decoration: none; color: green; font-size: 50px; } </style> </head> <body> <!--伪类选择器--> <a href="#">我是一个可爱的超链接!</a> </body> </html>鼠标未放上去正常样式
鼠标划入的样式
鼠标点击不松开的样式
编程学习
技术分享
实战经验