有没有可能编写一个CSS选择器,仅选择已调用text-overflow行为的元素?
<div style="width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
I don't want to select this
</div>
<div style="width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
But I do want to select this because it's overflowing
</div>
:hover
来改变鼠标悬停时的元素,以便溢出内容可见,并添加一些额外的样式,如边框和背景。我猜这就是你想要的效果?你无法区分哪些已经溢出和哪些没有,但这种效果对于任何情况都同样有效。 - Spudley