首页 > Web开发 > 详细

css 常用

时间:2018-03-09 18:33:43      阅读:137      评论:0      收藏:0      [点我收藏+]

超出N行文本,以...显示

.text {
    display: -webkit-box;
    -webkit-line-clamp: 3; // 行数
    -webkit-box-oritent: vertical;  // 方向
    overflow: hidden;
    text-overflow: ellipsis;
}

技术分享图片

超出N行文本,用渐变解决

.text {
  position: relative;
  overflow: hidden;
  line-height: 1.2em;
  height: 3.6em; /* exactly three lines */
}

.text:after {
  content: "";
  text-align: right;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20%;
  height: 1.2em;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
    80%
  );
}

技术分享图片

移动端去除点击边框

.text {
    -webkit-tap-highlight-color: transparent;
}

css 常用

原文:https://www.cnblogs.com/huxiaoyun90/p/8535251.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!