<div class="box">
<div style=" 100px;height:150px;">
解析:本题主解析:本题主解析:本题主
</div>
</div>
<style type="text/css">
.box {
display: flex;
align-items: center; //垂直
-webkit-align-items: center;//兼容浏览器写法
justify-content: center; //水平
-webkit-justify-content: center;//兼容浏览器写法
height: 500px;
300px;
}
</style>