元素居中显示的几种方法

第一种状况(子元素宽高不固定)web <div class="parent"> <div class="child"></div> </div> 方法一: 只设置父级便可(使用弹性盒子使子元素居中):flex .parent {orm display: flex;it justify-content: center;io align-items: center;form }class 注意
相关文章
相关标签/搜索