<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<style>
/*:focus伪类选择器用于选取获得焦点的表单元素*/
/*焦点就是光标,一般情况input类表单元素才能获取*/
input:focus {
background-color: palevioletred;
}
</style>
</head>
<body>
<input type="text" />
<input type="text" />
<input type="text" />
</body>
</html>
focus伪类选择器
最新推荐文章于 2023-02-18 21:19:38 发布