:focus 伪类 选择器:用于选取获得焦点的元素 。 我们这里主要针对的是 表单元素。
:hover
语法:
.total input {
border: 1px solid #ccc;
height: 30px;
40px;
transition: all .5s;
}
/*这个input 获得了焦点*/
.total input:focus {
80px;
border: 1px solid skyblue;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
input {
outline: none;
}
input:focus {
background-color: pink;
border: 1px solid red;
height: 50px;
}
</style>
</head>
<body>
<input type="text">
</body>
</html>
.page_skip input {
46px;
height: 36px;
border: 1px solid #ccc;
text-align: center;
/*过渡写在本身上 谁做动画,给谁加*/
transition: all 0.3s;
}
/*表单获得焦点后 */
.page_skip input:focus {
88px;
border: 1px solid skyblue;
}