【发布时间】:2021-05-01 10:22:27
【问题描述】:
我试图将三幅画布相互叠加显示,但它们只是彼此并排显示。我对css的经验很少。我需要添加什么?
<body>
<div id="canvas_container">
<canvas id="Background" width="330" height="330"></canvas>
<canvas id="mycanvas" width="330" height="330"></canvas>
<canvas id="Overlay" width="330" height="330"></canvas>
</div>
<style>
.canvas_container {
position: relative;
}
.container > canvas {
position: absolute;
top: 0;
left: 0;
}
</style>
<div id="codeinput">
<br>
The "X" goes here:<input type="text" id="shapeX">
<br>
The "Y" goes here:<input type="text" id="shapeY">
<br>
Choose the color: <input type="text" id="shapeColor" value="green">
<script>
unrelated javascript
</script>
<br>
<button onclick=makeSquare();>Draw shape</button>
</div>
</body>
【问题讨论】:
标签: html css canvas html5-canvas