在文本的最后一行添加elipsis [英] add elipsis on the last line of text
本文介绍了在文本的最后一行添加elipsis的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在最后一行添加elipsis我的markeup是:
I want to add elipsis on last line my markeup is:
<h4 class="heading4 js-heading4">Yellow gold Yellow gold Yellow gold</h4>
.heading4 {
height: 98px;
position: relative;
width: 200px;
overflow: hidden;
white-space: nowrap
}
黄金黄金黄色黄色...
如果文字溢出。
问题是如果我添加 text-overflow:ellipsis
,那么整个文本会出现在一行像:
黄金黄金黄... 我想在页面底部添加省略号。
if text is overflow.
problem is if i am adding text-overflow:ellipsis
then whole text is coming in one line like :
Yellow gold Yellow gold Yell... i want to add ellipsis at the bottom of page.
推荐答案
使用此jquery插件自动创建eclipses在文本的结尾根据您的要求,而不需要重塑的轮:
Use this jquery plugin to automatically create eclipses on the end of the text as per your requirement without reinventing the wheel:
http://dotdotdot.frebsite.nl/
这篇关于在文本的最后一行添加elipsis的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文