首页 > 解决方案 > 如何应用文本溢出:省略号和溢出:未设置在一起

问题描述

如何处理我需要设置的 css,overflow: unset让我在悬停时显示弹出提示,并ellipsis在单元格中的数据过大时显示?我的桌子下有以下 HTML。为了确保元素在悬停在元素上时div弹出不被元素覆盖的警告消息。我必须设置水平。设置好之后好像不行了?建议?我检查了一些帖子,都提到了, 所以我想知道是否有适合我的解决方案? 应用“文本溢出:省略号;” 到内部 div列表溢出;做文本溢出:省略号;tdspanoverflow: unsettdtext-overflowoverflow: hidden

我的代码:

.tr .td {
    position: sticky
    overflow: unset;
    z-index: 2;
    white-space: nowrap;
    text-overflow: ellipsis;
}
<tr>
  <td class="td" role="cell" style="position: sticky; left: 46px;">
     <span class="data" aria-expanded="false">
        cell data
        <div class="poptip" role="tooltip" aria-hidden="true"></div>
     </span>
  </td>
</tr>

标签: htmlcss

解决方案


推荐阅读