废话少说,直接代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
.box {
position: relative;
width: 200px;
height: 200px;
margin: 100px auto;
background-color: pink;
transition: all 3s linear;
}
.box:hover {
/* // 其实我们的HTML非常有意思,有一些特效非常好看! */
transform: scale(1.3)
}
.box::after {
position: absolute;
top: 50%;
right: 15px;
content: "";
display: block;
width: 15px;
height: 15px;
border-top: 1px solid #333;
border-right: 1px solid #333;
transform: translateY(-50%) rotate(45deg);
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>