html - 工具提示隐藏在表格标题后面
问题描述
我有一个关于工具提示的问题,工具提示隐藏在表格标题后面,或者它显示在一个没有显示的框中。
请参考提示隐藏在另一个 div 后面的图像(图像中显示的营销在提示中):
.tooltipCustom {
position: relative;
display: inline-block;
}
.tooltipCustom .tooltipCustomtext {
visibility: hidden;
width: 120px;
background-color: #efeee6;
color: #868474;
text-align: center;
border-radius: 6px;
padding: 5px 0;
border-width: 1px;
border-style: solid;
border-color: black;
/* Position the tooltip */
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -60px;
}
.tooltipCustom:hover .tooltipCustomtext {
visibility: visible;
}
<div class='tooltipCustom'>
<sup style="vertical-align: top">
Something
</sup>
<span class='tooltipCustomtext'>
Underlying price: List price <br/>
Applied Discounts: Marketing
</span>
</div>
解决方案
我认为上面的 div 定义了一个 z-index,你需要在你的工具提示上放一个更高的 z-index 值才能放在前一个 div 的前面:
.mypreviousDiv {
z-index: 100;
}
.tooltipCustom .tooltipCustomtext {
z-index: 101; // ou higher, for tooltips we can put 9999
}
推荐阅读
- c# - How to make Windows forms app to support Older versions of MS Office?
- python - Beautiful Soup : 如何从不一致的数据中提取 HTML 标签中的数据
- django - 如何在没有默认 Django 数据库表的情况下创建 Django 项目
- ios - 如何确定 Xcode 项目中图像的最佳尺寸?
- java - ubuntu命令行./idea.sh可以启动idea,但是桌面图标点击找不到JDK
- ios - 如何将Objective C函数的地址传递给C函数?
- bash - 如何在 git-bash 的 git 别名中使用一行连字符来分隔 git 命令结果
- c# - 选择页面时如何重新初始化选项卡控件页面上的自定义控件
- ios - SwiftUI如何在点击按钮时推送到下一个屏幕
- azure - 将 AD 用户身份验证传递给 Azure REST API 调用以预配资源