Google Chrome:当鼠标悬停在表格单元格上方时如何显示全文

时间:2018-06-27 18:57:46

标签: css google-chrome html-table overflow

预期的行为

我的网页上有一张桌子。在某些表格单元格中,它的文字很长,我将这些CSS设置为td标签。当文本长于表格单元格的宽度时,它将被隐藏。

td {
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

当鼠标悬停在这些表格单元格上时,我希望显示全文。

当前行为

对于野生动物园,当鼠标悬停在具有长文本的表格单元格上方时,将显示全文。 enter image description here

对于Google Chrome浏览器,当鼠标悬停在其上时,没有任何反应。 enter image description here 问题

谷歌浏览器如何显示Safari之类的全文?任何建议或想法都将受到欢迎。

2 个答案:

答案 0 :(得分:1)

我认为在您的情况下,最好在您的word4中放入“ title”属性。 More about Title Attributes

例如:

<td>

答案 1 :(得分:0)

您可以使用标题属性:https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title

<p>Newlines in title should be taken into account, like this <abbr title="This is a
multiline title">example</abbr>.</p>