如何将画布覆盖在桌子上

如何将画布重叠在图片上的桌子上?黄色部分是画布,我要在其中插入“乘法”和“等于”之类的图像。

如何将画布覆盖在桌子上

<canvas id="canvasminus" class="wrapper"></canvas>
<table id="table" align="center" class="wrapper">
                        <tr>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
</table>
canvasminus{
    z-index:1;
    margin:auto;
}

#table {
    z-index: 0;
}

.wrapper
{
    position:relative;    
}
hhxxttxsj 回答:如何将画布覆盖在桌子上

也许是这样吗?

td {
  position: relative;
  padding: 1em;
}

canvas {
  position: absolute;
  left: calc(100% - 10px);
  z-index: 10;
}
<table border="collapse">
  <tr>
    <th>Number</th>
    <th>Number</th>
    <th>Result</th>
  </tr>
  <tr>
    <td>
      <canvas id="myCanvas" width="20" height="20" style="border:1px solid #000000;background:red;">
</canvas>
      <div>12</div>
    </td>
    <td>
      <canvas id="myCanvas" width="20" height="20" style="border:1px solid #000000;background:red;">
</canvas>
      <div>12</div>
    </td>
    <td>24</td>
  </tr>
  <tr>
    <td>
      <canvas id="myCanvas" width="20" height="20" style="border:1px solid #000000;background:red;">
</canvas>
      <div>1</div>
    </td>
    <td> <canvas id="myCanvas" width="20" height="20" style="border:1px solid #000000;background:red;">
</canvas>
      <div>2</div>
    </td>
    <td>3</td>
  </tr>
</table>

本文链接:https://www.f2er.com/3162662.html

大家都在问