在页面中添加两个按钮和一外div元素,每点击按钮1,就让盒子的宽度加100px(样式操作) 2、点击按钮2,让盒子慢慢移动500px(定时器)
<!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>
div {
width: 200px;
height: 200px;
background-color: #f00;
transition: all 0.4s;
}
</style>
</head>
<body>
<button class="one">1</button>
<button class="two">2</button>
<div></div>
<script>
</script>
</body>
</html>