android 4.4.3 css hack 寫法

最近發現android在4.4.3上面出現不少怪異的現象,如今雖然沒有找到緣由和解決方案,可是忽然間找到一個css hack寫法;css

button{
        display:none;
        width:$rem*45;
        height:$rem*33;
        //我這裏Android 4.4.3 hack 寫法
        height:calc(1/16*32px);
        font-size:$rem*12;
        background-color:#b41a1a;
        border:1px solid #fff;
        color:#fff;
        padding:$rem*10 0;
        position:absolute;
        right: 0;
        top: 0;
        border-bottom-right-radius: 4px;
        border-top-right-radius: 4px;
    }

在ios和android4.4.4以上的版本顯示都正常的,就在4.4.3上線顯示的大小比其餘機型明顯大了個像素,百思不得其解,乾脆上了一個hack的寫法,4.4.3自己不支持calc,我就使用這個特性,讓支持的瀏覽器默認覆蓋前面的height值。實現hack的操做。android

這是calc的兼容性,徹底能夠將opera mini和android4.3之前的版本覆蓋掉。ios

有須要的朋友能夠get一把!!!瀏覽器

相關文章
相關標籤/搜索