css样式(单行文本超出部分以...显示)

 

效果图:

 

 

标题 {

height: 30px;

line-height: 25px;

margin-left: 6px;

margin-right: 8px;

font-size: 16px;

color: #3E3F40;

white-space: nowrap;/*规定段落中的文本不进行换行*/

text-overflow: ellipsis;/*text-overflow 属性规定当文本溢出包含元素时发生的事情。ellipsis 显示省略符号来代表被修剪的文本。*/

        overflow: hidden;/*隐藏溢出*/

background-size: 8px 15px;

}

 

正文 {

font-size: 13px;

text-align: left;

margin-left: 22px;

margin-right: 16px;

color: #898A8C;

white-space: nowrap;

text-overflow: ellipsis;

overflow: hidden;

}

question

posted @ 2015-12-27 13:57  cDoubleJ  阅读(544)  评论(0编辑  收藏  举报