如何实现不定宽高水平和垂直居中

xiaoxiao2021-02-28  61

1.使用CSS3 transform

外层容器

display:relative

内部元素

transform: translate(-50%,-50%); position: absolute; top: 50%; left: 50%;
转载请注明原文地址: https://www.6miu.com/read-72183.html

最新回复(0)