html代码:
<div class="wp">
<div class="box"></div>
</div>
方法一:
<style>
.wp { display: table; }
.box { display: table-cell; vertical-align: middle; }
</style>
方法二(该方法在华为型号:HUAWEI VNS-TL100有bug,无法居中)
.wp { position: relative; }
.box { display: table-cell; vertical-align: middle; }