本文介绍了溢出:在末端隐藏点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一个字符串我喜欢大屁股,我不能说谎,我用overflow:hidden切割它,所以它显示如下:
Let's say I have a string "I like big butts and I cannot lie" and I cut it with overflow:hidden, so it displays something like this:
我喜欢大屁股和大麻
切断文本。是否可以这样显示:
cutting off the text. Is it possible to display this like this:
我喜欢大屁股和我可以...
"I like big butts and I cann..."
使用CSS?
谢谢。
推荐答案
a href =https://developer.mozilla.org/en-US/docs/CSS/text-overflow =nofollow noreferrer> text-overflow:ellipsis; 其中支持所有主要浏览器。
You can use text-overflow: ellipsis; which according to caniuse is supported by all the major browsers.
这里是关于jsbin的。
Here's a demo on jsbin.
这篇关于溢出:在末端隐藏点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!