gpt4 book ai didi

html - 如何使输入元素文本溢出:ellipsis on IE?

转载 作者:行者123 更新时间:2023-11-28 03:51:39 32 4
gpt4 key购买 nike

我找到了我的

fiddle只在Chrome和FF上有效,不知道为什么在IE上没有省略号效果?希望有人能帮忙解决这个问题,如果能用CSS方式解决就更好了。

顺便说一句,似乎 div 在 IE 和 Chrome 上都有文本溢出:省略号效果。

CSS:

.ellip {
white-space: nowrap;
width: 200px;
overflow: hidden;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}

html:

<input type="text" class="ellip" value="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz">
<div class="ellip">abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</div>

最佳答案

.ellip:before {
content: ''; /* IE9 ellipsis fix */
}

示例:https://jsfiddle.net/svdbco/s1x0qx1a/

IE8 截图:

enter image description here

IE11截图:

enter image description here

关于html - 如何使输入元素文本溢出:ellipsis on IE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29740059/

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