Google Chrome中的HTML5画布和z-index问题
当我们将z索引应用于位置固定的画布时,停止它会导致chrome渲染所有位置已正确固定的其他元素。仅当画布的大小大于256X256px时才会发生这种情况。
用固定的div包裹h1和canvas并解决问题-
<div id = 'fixcontainer'> <h1>Test Title</h1> <canvas id = "backgroundCanvas" width = "1000" height = "300"></canvas> </div>
以下是CSS-
h1{
position: fixed;
}
body{
height: 1500px;
}
canvas{
position: fixed; z-index: -10;
}热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短