CSS 文本溢出:省略号在 IE 上不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14664195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 21:31:17  来源:igfitidea点击:

text-overflow:ellipsis doesn't work on IE

internet-exploreroverflowcss

提问by MultiformeIngegno

In thispage there are some links at the left sidebar that get cropped with:

页面中,左侧边栏中的一些链接被裁剪为:

.widget-area .textwidget li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

In Firefox/Chrome it's displayed properly: Screenshot from Firefox/Chrome

在 Firefox/Chrome 中,它正确显示: 来自 Firefox/Chrome 的截图

Unfortunately Internet Explorer 8/9/10...: Screenshot from IE 10

不幸的是 Internet Explorer 8/9/10...: IE 10 截图

The problem isn't IE 10 support for text-overflow:ellipsis.. for example thisworks on IE 10 too! What's wrong with my implementation? I also tried to add -ms-text-overflow:ellipsis, without any luck.

问题不在于 IE 10 支持 text-overflow:ellipsis .. 例如,这也适用于 IE 10!我的实现有什么问题?我还尝试添加 -ms-text-overflow:ellipsis,但没有任何运气。

回答by duri

Removing the word-wrap: break-wordproperty should help.

移除word-wrap: break-word财产应该会有所帮助。

回答by asifsid88

add width property to your CSS code..this would help..

将 width 属性添加到您的 CSS 代码中..这会有所帮助..

回答by Lucky

For IE you should add some extra code..like changing ur width property..or try using a dotdotdot jquery plugin..that would be an alternate solution.. Like this

对于 IE,你应该添加一些额外的代码..比如改变你的宽度属性..或者尝试使用 dotdotdot jquery 插件..这将是一个替代解决方案..像这样

http://dotdotdot.frebsite.nl

http://dotdotdot.frebsite.nl

Edit: Follow this link

编辑:点击此链接

Quirksmode textoverflow

Quirksmode 文本溢出

which tells you to set the width:100%for IE..

它告诉您 为 IE设置 width:100%..