您现在的位置是:首页 > 网站制作 > 前端设计

前端设计

CSS3文本(一)—text-overflow文本溢出

杨青 2013-08-02前端设计

text-overflow

说明:设置或检索是否使用一个省略标记(...)标示对象内文本的溢出。

浏览器支持: 所有主流浏览器都支持 text-overflow 属性。

语法:text-overflow: clip(默认值)| ellipsis ;

clip:修剪文本

ellipsis:显示省略符号来代表被修剪的文本。

示例

div.test

{

text-overflow:ellipsis;

}

1)clip: 直接将溢出的文字裁剪

This is some long text that will not fit in the box

2)ellipsis: 将溢出的文字显示省略标记(...)

This is some long text that will not fit in the box

文章评论