1

我有一个这样的 div -:

<div id="prep">Hey jony whats up. The new solar radars are of great use and may evern put some of the wacky scientist to brain strom. Crazy!</div>.

这是相关的 css -:

#prep {
    height:32px;
    font-weight:bold;
    overflow:hidden;
    text-overflow:ellipsis;
    font-family: Arial, Helvetica, sans-serif;
    font-size:13px;
    line-height:16px;
    display:block;
}

显然只有 2 行文本可见。但由于所有文本都不适合 div,我想显示ellipses在最后一个可见文本行的末尾。

4

1 回答 1

0
You need to add a width, and white space.

    width: 56px;
    white-space: nowrap;
于 2013-05-04T14:29:31.437 回答