首页 > 解决方案 > 工具提示隐藏在表格标题后面

问题描述

我有一个关于工具提示的问题,工具提示隐藏在表格标题后面,或者它显示在一个没有显示的框中。

请参考提示隐藏在另一个 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>

标签: htmlcsshandsontable

解决方案


我认为上面的 div 定义了一个 z-index,你需要在你的工具提示上放一个更高的 z-index 值才能放在前一个 div 的前面:

.mypreviousDiv {
  z-index: 100;
}

.tooltipCustom .tooltipCustomtext {
   z-index: 101; // ou higher, for tooltips we can put 9999
}

推荐阅读