求助! 畫(huà)布無(wú)法在適應(yīng)在瀏覽器正中間
<!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; ????????} ????????#canvas1{ ????????????position:?absolute; ????????????bottom:?0; ????????????left:?0; ????????????z-index:?1; ????????} ????????#canvas2{ ????????????position:?absolute; ????????????bottom:?0; ????????????left:?0; ????????????z-index:?0; ????????} ????</style> </head> <body> ????<div?calss="all_bg"> ????????<div?id="allcanvas"> ????????????<canvas?id="canvas1"??width="800"??height="600"></canvas> ????????????<canvas?id="canvas2"??width="800"??height="600"></canvas> ????????</div> ????</div> ????</body> </html>
一直顯示在瀏覽器左下角,而且ui設(shè)置應(yīng)該是畫(huà)布正中才對(duì),顯示卻偏右..
2017-01-20
??#allconvas{
這里canvas 單詞拼寫(xiě)錯(cuò)了,應(yīng)該是 #allcanvas