一、单行文本溢出显示省略号(...)
设置块元素的宽和高,然后使用三个属性(缺一不可)控制
overflow: hidden;
text-overflow:ellipsis;
white-space:nowrap;
Demo如下:
效果如下:
二、多行文本溢出显示省略号(...)
可以使用以下四个属性来控制:
overflow : ...
分类:
其他好文 时间:
2014-12-04 10:18:04
阅读次数:
116
一、使用css实现.slh {width:200px;display: block;overflow: hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;}优点:简单易用缺点:如果设置 /*td, t...
分类:
Web程序 时间:
2014-11-30 13:47:22
阅读次数:
242
[html] view
plaincopyprint?
span style="white-space:pre">span>span style="white-space:pre"> span>c:if test="${sessionScope.errorcode!=null}">
span style="wh...
分类:
Web程序 时间:
2014-11-27 10:42:42
阅读次数:
268
元素在content比较多的情况下,显示不全,需要省略显示,并且在鼠标停留的时候有全文提示。其实现方法是:css.test{white-space:nowrap;/*不换行*/overflow:hidden;/**/text-overflow:ellipsis;/*超长显示为省略号*/}标签的写法:...
分类:
Web程序 时间:
2014-11-26 11:08:40
阅读次数:
196
css属性white-space省略我吧 省略我吧省略我吧省略我吧省略我吧省略我吧省略我吧省略我吧省略我吧省略我吧测试浏览器:IE6/7/8/9、opera12.02、firefox15.0.1、chrome21.0.1180.89m1、text-overflow:ellipsis;这里的重点样式是...
分类:
Web程序 时间:
2014-11-25 13:59:06
阅读次数:
205
text-overflow: ellipsis;该属性用于定义文本溢出的显示方式css代码:.textEllipsis { overflow: hidden !important; white-space: nowrap !important; text-overflow: ell...
分类:
Web程序 时间:
2014-11-21 17:53:11
阅读次数:
197
Styles: table{ table-layout:fixed; } table td{ text-overflow:ellipsis;overflow:hidden;white-space: nowrap; }
分类:
其他好文 时间:
2014-11-21 14:05:01
阅读次数:
279
a{ display: block; /*定义显示形式*/ overflow: hidden; /*截取超出字符*/ text-overflow: ellipsis; /*超出字符以…代替*/ white-space: nowrap; ...
分类:
Web程序 时间:
2014-11-21 12:00:40
阅读次数:
212
css:
width: 350px;
display: block;
white-space:nowrap;
overflow: hidden;
text-overflow:ellipsis;...
分类:
Web程序 时间:
2014-11-19 10:59:41
阅读次数:
173
平时用的多的强制不换行:div{white-space:nowrap;width:***;text-overflow:ellipsis;overflow:hidden}white-space:normal 默认;nowrap强制在同一行内显示所有文本,直到文本结束或者遭遇 br 对象text-ove...
分类:
其他好文 时间:
2014-11-17 15:38:29
阅读次数:
163