作弊文本溢出+ -webkit-line-clamp?

时间:2013-11-20 18:36:32

标签: html ellipsis css css3

以下是从此问题中复制的示例

Limit text length to n lines using CSS

小提琴中显示的解决方案看起来很好,直到我将行高改为60%。然后在省略号后面显示以下文本。请注意下图中“...”之后的文字。

enter image description here

我对CSS中行高的更改如下。

.box .text {
    color:                      #333;
    padding:                    20px;
    width:                      204px;
    overflow:                   hidden;
    background:                 #E0E0E0;
    font-size:                  .95em;
    line-height:                1;
    text-align:                 justify;
    line-height: 60%; /* Added line height here */
}

我的小提琴就在这里。

http://jsfiddle.net/marsant/csYjC/1140/

有没有避免这种作弊的外表?因此,无论行高度如何变化,文本都不会出现在省略号之后。

0 个答案:

没有答案
相关问题