css實(shí)現(xiàn)字符串截?cái)嗖⒓邮÷蕴?hào)示例

字號(hào):


    代碼如下:
    <html>
    <head><title></title></head>
    <style>
    .title{
    width:100px;
    white-space:nowrap;
    word-break:keep-all;
    overflow:hidden;
    text-overflow:ellipsis;
    }
    </style>
    <body>
    <span class=title>標(biāo)題顯示太長(zhǎng)省略多余部分并加省略號(hào)的樣式</span>
    <div class=title>標(biāo)題顯示太長(zhǎng)省略多余部分并加省略號(hào)的樣式</div>
    </body>
    </html>