多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
#### **水平垂直居中方法** #### 方法一用定位 ~~~ child{ position:absolute; top: 50%; left: 50%; margin-top: - (负)child宽度的一半(写具体值) margin-left: -( 负)高度的一半(写具体值) ~~~ #### 方法二 flex ~~~ praent{ justify-content:center; align-items:center; } ~~~ #### 方法三 定位 ~~~ child{ position:absolute; top:50%;left: 50%; transform: translate(-50%, -50%); } ~~~ #### 方法四 ~~~ child{ position:absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto; } ~~~