其他分享
首页 > 其他分享> > flex上下左右居中

flex上下左右居中

作者:互联网

父元素CSS

box-sizing: border-box;
padding-left: 10px;
padding-right: 10px;
display: flex;
align-items: center;
-webkit-box-pack: justify;
justify-content: space-between;

子元素CSS

width: 100%;
word-wrap: break-word;
word-break: break-all;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-size: 14px;
font-weight: bold;
color: #fff;
text-align: center;

标签:居中,flex,word,上下左右,box,break,end,font,margin
来源: https://www.cnblogs.com/jyc226/p/15162025.html