div不定宽高,文字垂直居中_css3

 

<div style="width:100%; height:100%; background:rgba(0,0,0,0.7); display:flex; justify-content:center; align-items:center;">
<div style="width:50%; height:50%; background:pink;color:#000000;text-align:center;align-items:center; justify-content:center; display: -webkit-flex;">
<div>
<div>第一行</div>
<div>第二行</div>
<div>第三行</div>
</div>
</div>
</div>