我在画布上显示悬停时的跨度有问题。我在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;
}
我很快做了这个小提琴。主要问题是您的:hover语句。在CSS第22行的小提琴中。
http://jsfiddle.net/robbiebardijn/hDbq3/
#graphs:hover #tooltip
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句