单行文本溢出显示省略号

overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
多行文本显示省略号

display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;

但是你会发现有的浏览器设置上-webkit-box-orient: vertical; 不起作用

解决方式如下

/* autoprefixer: off */
  -webkit-box-orient: vertical; // 参考 https://github.com/postcss/autoprefixer/issues/776
  /* autoprefixer: on */
通过腻子来实现生效

相关文章:

  • 2021-12-15
  • 2021-12-11
  • 2021-10-20
  • 2021-12-15
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
猜你喜欢
  • 2021-12-23
  • 2021-12-12
  • 2022-01-03
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案