CSS 高度居中方案
实现高度自适应并且上下居中
<div id="wrap"> <div class="box">DemoSeat</div> </div> <style> #wrap { position: fiexd; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; .box { veralign: middle; width: 500px; margin: 0 auto; &:before { content: ''; display: inline-block; width: 0; height: 100%; veralign: middle; } } } </style>