工具提示隐藏在表格的标题后面

问题描述 投票:0回答:2

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

请参考提示隐藏在另一个div后面的图像(图像中显示的营销位于提示中):

enter image description here

.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>
html css css3 handsontable
2个回答
0
投票

修理它

/* Position the tooltip */
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -60px;

例如

/* Position the tooltip */
position: absolute;
top: 20px;
left: 50%;
margin-left: 0;

0
投票

我认为上面的div有一个z-index定义,你需要在你的工具提示上放一个更高的z-index值,使其位于前一个div的前面:

.mypreviousDiv {
  z-index: 100;
}

.tooltipCustom .tooltipCustomtext {
   z-index: 101; // ou higher, for tooltips we can put 9999
}
© www.soinside.com 2019 - 2024. All rights reserved.