【发布时间】:2013-12-26 11:23:19
【问题描述】:
我无法在画布上显示悬停时的跨度。我在 Stack Overflow 上找到了很多文章,但我不明白。
这是我的html:
<section id="graphs">
<span id="tooltip">thisistest</span>
<canvas id="myChart" class="tooltip" width="550" height="350"></canvas>
</section>
这个css:
//This part works
span#tooltip {
display: none;
position: relative;
top: 8px;
left: 10px;
padding: 5px;
margin: 10px;
z-index: 100;
background: #333;
border: 1px solid #c0c0c0;
opacity: 0.8;
width: 300px;
color: White;
text-align: left;
}
//This does not show the span...
canvas.tooltip:hover #tooltip {
display: block;
}
【问题讨论】: