css省略符號效果

來源:互聯網
上載者:User
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>New Document </title>
    <style>
        .ctl
        {
            table-layout: fixed;
        }
        .xx
        {
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            padding: 2px;
        }
        
        .ellipsis {width:50%;text-overflow:ellipsis; }/*just for ie*/
        ul
{
    padding: 0px;
    margin: 0px;
    list-style: none;padding-left:10px;
    
    
}
        li{
        
        
        width:90%;     
white-space:nowrap;     
text-overflow:ellipsis;     
-o-text-overflow:ellipsis;     
overflow: hidden;      
        }
        
    </style>
</head>
<body>

<div style="width:80%;border:1px solid red">
<ul>
        <li><span>1</span><span class="ellipsis">小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;</span></li>
        <li><span>1</span>小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;</li>
        <li><span>1</span>小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;</li>
        <li><span>1</span>小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;</li>
    </ul>
    </div>
    <table cellspacing="0" cellpadding="1" width="100%" class="ctl" border="1">
        <tbody>
            <tr>
                <td class="xx">
                    <a href="#"><font>小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;</font></a>
                </td>
                <td style="width:60px">
                    (1/1)
                </td>
            </tr>
            <tr>
                <td>
                    小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;
                </td>
                <td>
                    (1/1)
                </td>
            </tr>
            <tr>
                <td>
                    小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;
                </td>
                <td>
                    (1/1)
                </td>
            </tr>
            <tr>
                <td>
                    小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;小王童鞋是大壞蛋;
                </td>
                <td>
                    (1/1)
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.