focus焦点伪类分布器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* :focus伪类选择器用于选取获得焦点的表单元素 */
/* 焦点就是光标,一般情况<input>表单元素才能获取,因此这个选择器也主要针对表单元素来说 */
input:focus {
/* 改背景颜色 */
background-color: yellow;
/* 改text框里面的字体颜色 */
color:rgb(255, 81, 0);
}
</style>
</head>
<body>
<input type="text">
<input type="text">
<input type="text">
</body>
</html>
运行效果: