css 超出省略号
width:220px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; -o-text-overflow:ellipsis;
说明:
white-space:nowrap;
表示文本不会换行,在同一行继续,知道遇到标签为止;overflow:hidden;
不显示超过对象尺寸的内容,就是把超出的部分隐藏了;text-overflow:ellipsis;
当文本对象溢出是显示...,当然也可是设置属性为clip不显示点点点;-o-text-overflow
:ellipsis为了兼容opera浏览器;
2行超出省略号:
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; overflow:hidden;
END