css 兼容性总结

1、css 解决单行文本溢出

      p{

         overflow: hidden;
         text-overflow:ellipsis;
         white-space: nowrap;

      }

2、css 解决多行文本溢出

      p{

         height: 40px;
         line-height: 20px;
         overflow: hidden;
         position: relative;

      }

     p::after{

        content: "...";
        width: 70%;
        position: absolute;
        bottom: 0;
        left: 30.2%;
        padding-left: 3px;
        background: -webkit-linear-gradient(left, transparent, #fff 0%);
        background: -o-linear-gradient(right, transparent, #fff 0%);
        background: -moz-linear-gradient(right, transparent, #fff 0%);
        background: linear-gradient(to right, transparent, #fff 0%);

     }

猜你喜欢

转载自blog.csdn.net/yuelinana/article/details/79652732
今日推荐