【发布时间】:2018-04-02 01:28:42
【问题描述】:
CSS 不适用于跨度标签悬停,它位于 Internet Explorer 中的按钮标签内,我有一个按钮,如果你将鼠标悬停在它上面,它将显示工具提示,我希望如果你悬停工具提示它应该消失,它正在工作FF 和 chrome 但不是 IE,我知道我应该使用
.tooltip:悬停.tooltiptext
而不是
.tooltiptext:悬停
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
.tooltiptext:hover {
display: none;
}
<!DOCTYPE html>
<html>
<body style="text-align:center;">
<div class="tooltip">
<button type="button">Hover me
<span class="tooltiptext">Tooltip text</span>
</button>
</div>
</body>
</html>
有什么建议,我也愿意使用 jquery。谢谢。
【问题讨论】:
-
哪个版本的 IE 导致问题?
-
我正在通过 IE 11 进行测试
标签: jquery html css internet-explorer