C S S : f o c u s CSS:focus CSS:focus伪类选择器
作用:一个输入字段获得焦点时选择的样式。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
input:focus {
background-color: lightblue;
}
</style>
</head>
<body>
请输入姓名:<input type="text"><br>
请输入学号:<input type="text"><br>
</body>
</html>
效果图: