gpt4 book ai didi

html - 文本溢出问题 : ellipses in a specific height paragraph

转载 作者:行者123 更新时间:2023-11-28 04:18:59 24 4
gpt4 key购买 nike

例如我有一个特定高度的段落。我希望所有超过那个高度的东西都变成省略号(...),而不是像图片中那样将句子切成两半: enter image description here

我试过使用 text-overflow: ellipses 但没用。请帮我解决这个问题。谢谢!

最佳答案

试试这段代码

div{display:block;width:300px;text-overflow:ellipsis;;overflow-y:scroll;max-height:200px;

display: -webkit-box;
-webkit-line-clamp: 7;
-webkit-box-orient: vertical;
}
<div>this is text this is text this is textthis is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text</div>

关于html - 文本溢出问题 : ellipses in a specific height paragraph,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42313424/

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