利用CSS使多余文字以省略号显示

注意的是一定要控制div的宽度,否则没有效果
css控制:text_ellipsis以省略号显示,test_clip 以截断文字方式显示。

<style type="text/css">

.text_ellipsis {text-overflow:ellipsis; overflow:hidden; white-space:nowrap; width:300px;}
.test_clip {text-overflow:clip; overflow:hidden; white-space:nowrap; width:300px;}
</style>
posted @ 2012-09-18 10:49  yanqing07  阅读(191)  评论(0编辑  收藏  举报