CSS样式,实现子标签在父标签中水平和垂直居中

来源:互联网 发布:软件开发项目预算表 编辑:程序博客网 时间:2024/05/24 05:44

子标签在父标签中垂直居中css样式写法:

.parent_div

{

justify-xontent:center;

display:flex;

align_items:center;

}

子标签在父标签中水平居中css样式写法:

.son_div

{

margin:0px auto;

text-align:center;

}


父标签自适应子标签高度css样式写法:

.son_div

{

justify-content : flex-start;

display:flex;

}


0 0