文本溢出处理

1.单行文本溢出

el{
  width: xxx;

  /* 溢出省略...三件套 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

2.多行文本溢出处理

  • 后端返回合适的文本(固定字数、符号等)
  • 前端进行截断
el{
  /* 只显示五行 */
  height: 100px;
  line-height: 20px;
  overflow: hidden;
}

猜你喜欢

转载自blog.csdn.net/qq_33576343/article/details/86439970
今日推荐