当前位置:Gxlcms > html代码 > position:fixed如何兼容浏览器低版本

position:fixed如何兼容浏览器低版本

时间:2021-07-01 10:21:17 帮助过:63人阅读

项目中遇到的坑,写篇博客做个笔记纪念下,position: fixed一般来说都兼容各个浏览器,但是要兼容浏览低版本问题,就得用-webkit-transform: translateZ(0);这段代码了。

项目中用到position: fixed;z-index: xxx;的时候,记得加上这个css:-webkit-transform: translateZ(0); 这个兼容position:fixed浏览器低版本 不然会有浏览器滚动出现闪烁bug。当然这里透明度opacity: 0.9;
也要做兼容的,这里就不具体做解释了。


.footer_main{
    position: fixed;
    height: 150px;
    background: url(/static/web-v2.0/images/ad/IT/IT_footer.png) no-repeat top center;
    width: 100%;
    left: 0;
    bottom: 0;
    z-index: 9;
    opacity: 0.9;
    -webkit-transform: translateZ(0);
}

以上就是position:fixed如何兼容浏览器低版本的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行