<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>伪类</title>
<style>
/*
link 没有被点击过的样式
*/
p a:link {
color: red
}
/*
visited 点击之后/访问之后的链接样式
*/
p a:visited {
color: green
}
/*
hover 鼠标经过/指向的样式
*/
/*当鼠标经过a标签的时候*/
p a:hover {
/*清除a标签默认的下划线*/
text-decoration: none;
color: pink
}
/*
active 鼠标点击时候的样式
*/
p a:active {
background-color: yellow
}
/*
focus 获取焦点的时候
*/
input:focus {
/*取消输入框聚焦时的轮廓线*/
outline: none
}
</style>
</head>
<body>
<p>
<a href="https://www.baidu.com">百度一下</a>
</p>
<input aria-label="" type="text" name="">
</body>
</html>
27、伪类
最新推荐文章于 2024-09-16 06:30:00 发布