平移属性实现小球滚动
<!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 {
}
.red {
width:100px;
height:100px;
border-radius:50%;
background-color: red;
transition:all 3s;
}
.red:hover {
transform:translateX(800px);
background-color: pink;
}
</style>
</head>
<body>
<div class="box">
<div class="red">
</div>
</div>
</body>
</html>