text-overflow:省略号无法与< br>在IE [英] text-overflow:ellipsis does not work with <br> in IE

查看:119
本文介绍了text-overflow:省略号无法与< br>在IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用文字溢出:省略号,并且在IE中的标记中有 br标记,则第二行不会被截断。

When using text-overflow:ellipsis and there is br tag in markup in IE then second line is not cut off.

标记

<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


b $ b

预期(如何在其他浏览器中使用)

reall...
reall...

这里是 fiddle

推荐答案

这可能是解决方案之一IE

This could be one of the solutions for IE

< div class =text>
真长文本
< br />
< div class =text>真长文本
< / div>
< / div>

这篇关于text-overflow:省略号无法与&lt; br&gt;在IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆