<div class="parent"> <div class="child">阿斯顿法定测试测试测试测试测试测试测试</div> </div>
.parent{background:#f00;width:100%;height:100%;display:flex;justify-content:center} .child{width:50%;height:50%;background:#ccc;}