CSS提示框未显示在所有元素的上方(无JavaScript)

3
我如何在所有HTML元素上方显示工具提示? http://jsfiddle.net/Fk79x/
<div class="wrapper">Lorem ipsum dolor 
   <div class="tooltip">Lorem ipsum dolor</div>
</div>
1个回答

2
好的,我已经在你的HTML DIV中添加了4个新的ID。
<div class="wrapper" id="test1">Lorem...
<div class="wrapper" id="test2">Lorem...
<div class="wrapper" id="test3">Lorem...
<div class="wrapper" id="test4">Lorem...

并添加了这个新的CSS:

#test1 {
    z-index:40;
}
#test2 {
    z-index:30;
}
#test3 {
    z-index:20;
}
#test4 {
    z-index:10;
}

这里有演示:jsFiddle


1
你的 jsFiddle 和我的没有区别(z-index 没有效果)。 - Vitaliy Hayda
@VitaliyHayda 我的更改在Firefox中有效,但刚刚检查发现在Safari和Chrome中无效。我会仔细查看。 - totallytotallyamazing
@VitaliyHayda 希望这次能够满足您的期望。我这次在FF、Chrome、Safari和Opera中进行了测试。 - totallytotallyamazing
1
@VitaliyHayda 没关系,我很高兴能帮忙!但是如果您可以在我的答案旁边点击上箭头,我将非常感激!有关正确的协议,请参阅此链接http://stackoverflow.com/help/someone-answers PS:您也可以对评论进行投票。 - totallytotallyamazing
谢谢@VitaliyHayda! - totallytotallyamazing

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接