要居中的元素C没有width属性及height属性
by panxiaoxian
HTML
<div id='father'>
<div id='son'>
潘小闲 潘小闲
</div>
</div>
CSS
#father {
background-color: red;
display:flex;
height:80px;
align-items:center;
justify-content:center;
}
#son {
background-color: yellow;
}