-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (43 loc) · 1.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>推箱子</title>
<style>
#game{
margin: 0 auto;
position: relative;
}
#game .item{
position: absolute;
width: 45px;
height: 45px;
background-size: 100% 100%;
/* 用JS控制坐标 */
}
#game .wall{
background-image: url("imgs/wall.jpg");
}
#game .box{
background-image: url("imgs/box.png");
}
#game .player{
background-image: url("imgs/player.png");
}
/* 正确状态的箱子 */
#game .correct-box{
background-image: url("imgs/over_box.png");
}
#game .correct{
border: 2px solid rgb(24, 151, 24);
/* 设置下面的属性之后,宽高影响的范围是边框盒 */
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="game">
</div>
<script src="js/index.js" type="module"></script>
</body>
</html>