CSS截取字符串

<style>
.jiequ {
    width:100px;
    white-space:nowrap;
    overflow:hidden;
    float:left;
    -o-text-overflow:ellipsis;     /* for Opera */
    text-overflow:ellipsis;        /* for IE */
}
.jiequ:after {
    content:"...";   /* for Firefox */
}
</style>
<span class ="jiequ">今天天气不错,我们一起去海边吧!</span>


你可能感兴趣的:(CSS截取字符串)