为什么两个convas没有叠在一起?求大神!!!

来源:1-2 搭建HTML网页结构

yuantongxin

2015-10-04 13:09

<!DOCTYPE HTML>

<html>

<head>

<meta charset="utf-8">

<title>tinyHeart</title>

<style type="text/css">

body{

padding-top:10px;

}

.all_bg{

width:800px;

height:600px;

margin:0px auto;

}

#allconvas{

position:relative;

width:800px;

height:600px;

margin:0px;

}

#convas1{

position:absolute;

bottom:0;

left:0;

z-index:1;

}

#convas2{

position:absolute;

bottom:0;

left:0;

z-index:0;

}

</style>

</head>

<body>

<div class="all_bg">

<div id="allcanvas">

<canvas id="canvas1" width="800" height="600"></canvas>

<canvas id="canvas2" width="800" height="600"></canvas>

</div>

</div>

<script type="text/javascript" src="js/main.js"></script>

<script type="text/javascript" src="js/commonFunctions.js"></script>

<script type="text/javascript" src="js/background.js"></script>

<script type="text/javascript" src="js/ane.js"></script>

<script type="text/javascript" src="js/fruit.js"></script>

<script type="text/javascript" src="js/mom.js"></script>

<script type="text/javascript" src="js/collisior.js"></script>

<script type="text/javascript" src="js/baby.js"></script>

</body>

</html>


写回答 关注

1回答

  • 化龙贝
    2015-10-04 22:11:07
    已采纳

    [汗] convas 是什么鬼?

    yuanto...

    非常感谢!

    2015-10-27 09:27:16

    共 1 条回复 >

HTML5小游戏---爱心鱼(上)

学做HTML5游戏,轻轻松松带你上手,适合刚入手游戏开发的同学

92350 学习 · 551 问题

查看课程

相似问题