用css定义长字符串的截断显示

原效果

我是一个很长很长很长的字符串

截取后

我是一个很长很长很长的字符串

width: 8em; 
text-overflow: ellipsis; 
overflow: hidden; 
white-space: nowrap;

  

posted @ 2012-10-22 18:33  xngeer  阅读(760)  评论(0编辑  收藏  举报