gpt4 book ai didi

html - 如何给溢出的文本最少 2 行的空间?

转载 作者:搜寻专家 更新时间:2023-10-31 19:29:10 24 4
gpt4 key购买 nike

预期的输出应该至少有 2 行高

enter image description here

我想保留 text-overflow: ellipsis 属性

<div style="min-height: 128px;
border-radius: 7px;
box-shadow: 0 2px 4px 0 rgba(210, 210, 210, 0.5);
border: solid 0.3px rgba(26, 25, 25, 0.15);
background-color: #ffffff;
width: 268px;
margin-bottom: 13px;">


<div style=" width: 100px; font-family: Roboto;
font-size: 13px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0.29px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-top: 5.6px;
height: 49px;">
Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make
this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’?

</div>

</div>

最佳答案

通过此 answer 获得了使用 -webkit-line-clamp 的最佳方法(在 IE 中不起作用)

<div style="min-height: 128px;
border-radius: 7px;
box-shadow: 0 2px 4px 0 rgba(210, 210, 210, 0.5);
border: solid 0.3px rgba(26, 25, 25, 0.15);
background-color: #ffffff;
width: 268px;
margin-bottom: 13px;">


<div style=" font-family: Roboto;
font-size: 13px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0.29px;
overflow: hidden;
text-overflow: ellipsis;
padding-top: 5.6px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;">
Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make
this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’?

</div>

</div>

关于html - 如何给溢出的文本最少 2 行的空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57581957/

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