input 选中时边框变色
2022-10-21 15:22:44
`input` 选中时边框变色,可以使用 `:focus` 伪类。
```html
<!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>
input {
border: 1px solid gray;
}
input:hover {
border: 1px solid orangered;
}
input:focus {
border: 1px solid orangered;
outline: 1px solid orangered;
}
</style>
</head>
<body>
<input type="text">
</body>
</html>
```