如何将画布标记与超链接标记一起使用 //这是html部分的代码 //这是css部分的代码 #爸爸{ 位置:相对位置; 顶部:-545px; 左:480px; } #网{ 位置:相对位置; 顶部:-510px; 左:460px; } #动画{ 位置:相对位置; 顶部:-590px; 左:460px; }

如何将画布标记与超链接标记一起使用 //这是html部分的代码 //这是css部分的代码 #爸爸{ 位置:相对位置; 顶部:-545px; 左:480px; } #网{ 位置:相对位置; 顶部:-510px; 左:460px; } #动画{ 位置:相对位置; 顶部:-590px; 左:460px; },html,css,canvas,html5-canvas,Html,Css,Canvas,Html5 Canvas,此代码在画布中创建了超链接..但它占用了画布标记后的空间。我试了所有的例子。但它不起作用。我的代码有什么问题。您可以使用位置:绝对,这使得)在画布中我创建了3个框。我给出了3个指向这些框的链接。这是我的问题,在这些标签之前我还有3个链接。如果我应用了u-r代码,它也将应用于其他链接。我没有得到..@user3232585你想让这3个盒子在画布中吗? // This is the code in html part <canvas id="canvas" width="684" heigh

此代码在画布中创建了超链接..但它占用了画布标记后的空间。我试了所有的例子。但它不起作用。我的代码有什么问题。

您可以使用
位置:绝对,这使得

在画布中我创建了3个框。我给出了3个指向这些框的链接。这是我的问题,在这些标签之前我还有3个链接。如果我应用了u-r代码,它也将应用于其他链接。我没有得到..@user3232585你想让这3个盒子在
画布中吗?
// This is the code in html part

<canvas id="canvas" width="684" height="606" style="background-color:#999999">

</canvas>
<a href="links/animation.html"><div style="width: 630px;height: 130px;" id="animation"></div></a>
<a href="pa1.html"><div style="width: 630px;height: 190px;" id="PA"></div></a>
<a href="web.html"><div style="width: 630px;height: 135px;" id="web"></div></a>

//This is the code in css part
#PA{
  position:relative;
  top:-545px;
  left:480px;
}
#web{
  position:relative;
  top:-510px;
  left:460px;
}
#animation{
  position:relative;
  top:-590px;
  left:460px;
}
a:nth-of-type(1){
  position:absolute;
  top:50px;
  left:50px;
  background:red;
}

a:nth-of-type(2){
  position:absolute;
  top:100px;
  left:100px; 
  background:pink;
}

a:nth-of-type(3){
  position:absolute;
  top:150px;
  left:150px; 
  background:purple;
}

canvas{
    border:1px solid black;
}