CSS 文字垂直居中

div.wrap { display: table; width: 100%; position: absolute; left: 0; top: 0; height: 100%; text-align: center; font-size: 1.2em; line-height: 1.2em; vertical-align: middle; color: #094D7E; font-weight: bold; _position: absolute; overflow: hidden; }
div.subwrap { vertical-align: middle; display: table-cell; _position: absolute; _top: 50%; }
div.content { _position: relative; _top: -50%; }
<div class="wrap">
    <div class="subwrap">
        <div class="content">xxx</div>
    </div>
</div>
posted @ 2014-07-25 16:44  allvie  阅读(149)  评论(0编辑  收藏  举报