前两天,看到的弹球小游戏,自己尝试做了一下。
分为三个部分,整体的一个框,小球,还有木板。
分别在他们三个下设置其属性:
<style>
#father{width:400px;
height:400px;
background-color:#999;
margin:0 auto;
position:relative;
}
#ball{width:30px;
height:30px;
background:#069;
border-radius:100%;
position:absolute;
}
#board{width:60px;
height:30px;
background-color:#F00;
position:absolute;
bottom:0px;
left:170px;
}
</style>
<body>
<div id="father">
<div id="ball"></div>
<div id="board"></div>
</div>
</body>
初步结构已经构建出来了