transform:translate(-50%,-50%)是css3的新特性
在需要进行水平居中时,例如toast弹出居中。使用
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
来实现toast组件的水平居中。
transform:translate(-50%,-50%)是css3的新特性
在需要进行水平居中时,例如toast弹出居中。使用
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
来实现toast组件的水平居中。