多行文本垂直居中

<style type="text/css">
        .warp{
            width: 200px;
            height: 150px;
            overflow: hidden;
            display: table;
            border: 1px solid #000;
            *position: relative;
        }
        .sub_warp{
            display: table-cell;
            vertical-align: middle;
            *position: absolute;
            *top: 50%;
        }
        .content{
            *position: relative;
            *top: -50%;
        }
    </style>
     <div class="warp">
         <div class="sub_warp">
             <div class="content">
                垂直居中不<br/>
                啊哈哈
            </div>
         </div>
     </div> 
      

 

posted @ 2013-02-28 15:05  kpbiao  阅读(152)  评论(0编辑  收藏  举报