gpt4 book ai didi

css - 文本溢出 :ellipsis does not work with
in IE

转载 作者:行者123 更新时间:2023-11-28 08:56:18 25 4
gpt4 key购买 nike

当使用 text-overflow:ellipsis 并且在 IE 中的标记中有 br 标签 时,第二行不会被截断。

标记:

<div class="text">
really long text
<br/>
really long text
</div>

CSS:

.text{
width: 50px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

输出:

reall...
really long

预期(它在其他浏览器中的工作方式):

reall...
reall...

这里是 fiddle

最佳答案

这可能是 IE 的解决方案之一

<div class="text">
really long text
<br/>
<div class="text">really long text
</div>
</div>

关于css - 文本溢出 :ellipsis does not work with <br> in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31022769/

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