<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
#game {
width: 800px;
height: 600px;
background: url(imgs/sky.png);
/*?*/
position: relative;
overflow: hidden;
}
#bird {
height: 25px;
width: 34px;
background: url(imgs/birds.png) -8px -10px no-repeat;
/*子绝父相*/
position: absolute;
top: 100px;
left: 100px;
}
#pp{
text-align: center;
font-size: 30px;
}
</style>
</head>
<body>
<div id="game">
<div id="bird"></div>
</div>
<p id="pp"></p>
<input type="button" name="" value="重新开始" id="btn">
<script>
HTML制作制作小游戏
最新推荐文章于 2024-08-18 09:56:07 发布
本文详细介绍了如何利用HTML语言创建一款简单有趣的小游戏,通过实例讲解了HTML在游戏开发中的应用,适合初学者入门。
摘要由CSDN通过智能技术生成