UC浏览器在宽高固定下,margin:auto,上下左右0;不能水平垂直居中是什么原因?
#globalTip{
position: fixed;
left: 0;
right: 0;
top:0;
bottom:0;
z-index: 99999;
width:75%;
height: 50px;
line-height: 50px;
text-align: center;
background-color: #000;
color:#fff;
font-size: 1.6rem;
border-radius: 20px;
}
如果position:absolute就可以,但这并不是我想要的。
在absolute和fixed定位方式下使用
#globalTip{
position: fixed;
left:50%;
top:50%;
-webkit-transform:translate3d(-50%,-50%,0);
transform:translate3d(-50%,-50%);
}