gpt4 book ai didi

javascript - 如何使用 CSS 为所有浏览器使用多行省略号

转载 作者:行者123 更新时间:2023-11-28 07:48:06 25 4
gpt4 key购买 nike

这适用于单行,但我希望它适用于多行。

div {
display: block;
height: 54px;
margin: 0 auto;
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 300px;
}
<div>
There are no questions currently added
There are no questions currently added
There are no questions currently added
</div>

最佳答案

你需要像下面这样添加跨度

<div>
<span>There are no questions currently added</span>
<span>There are no questions currently added</span>
<span>There are no questions currently added</span>
</div>

DEMO

关于javascript - 如何使用 CSS 为所有浏览器使用多行省略号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30594082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com