Why webkit line clamping does not work in firefox?

前端 未结 4 1854
轮回少年
轮回少年 2021-02-07 01:15

I use this webkit line clamp, it works in Chrome, but not in Firefox. The following is the code:

{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -we         


        
4条回答
  •  感情败类
    2021-02-07 01:52

    /----line clamp---/

    .line-clamp {
        position: relative;
        height: 2.7em; 
        overflow: hidden;
    }
    .line-clamp:after {
        background: $white;
        bottom: 0;
        position: absolute;
        right: 0;
        float: right;
        content: '\2026';
        margin-left: -3rem;
        width: 1rem;
    }
    
    @supports (-webkit-line-clamp: 2) {
        .line-clamp {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            / autoprefixer: off /
            -webkit-box-orient: vertical; 
            / autoprefixer: on /
            max-height:3.6em; 
            height: auto;
        }
        .line-clamp:after {
            display: none;
        }
    }
    

    /----line clamp end---/

提交回复
热议问题