CSS文字溢出overflow处理

Posted on 2007-09-17 13:44  Leon0812  阅读(828)  评论(0)    收藏  举报

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<body>
    <style tyep="text/css">
    div {margin:5px 0;overflow:hidden;width:200px;}

    div.a {border:1px solid red; text-overflow:ellipsis;white-space:nowrap;}
    div.b {border:1px solid green;                                        text-overflow:ellipsis;-o-text-overflow:ellipsis;white-space:nowrap;}
    div.c {border:1px solid blue; text-overflow:ellipsis;-o-text-overflow:ellipsis;}

    </style>

    <div class="a">
    test somthing here.test somthing here.test somthing here.test somthing here.test somthing here.
    </div>

    <div class="b">
    毒其1发缩短发送毒发缩短发撒阿瑟发送发送发缩短发送毒发斯多夫阿瑟毒发撒test111 1111111111111112133435te st1111111111111111112133435 test111111 111 111111 11121 334353 5345345
    </div>

    <div class="c">
    test1111111111111111112133435test1111111111111111112133435test111111111111111111213343535345345    </div>

    <div class="c">
    test 11111 1111111 1111112133 435te t111 111111 1111111112133435 test1111111111 111111112 13343 53 5345345
    </div>
</body>
</html>

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3