码迷,mamicode.com
首页 > Web开发 > 详细

css 设置文本垂直居中

时间:2015-03-31 19:39:47      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

html:

<div class="dialog-cont">
       <div class="dialog-stic">
              <p>FedEx Express invented for more than 3.9 million shipments each business day.</p>
       </div>
</div>

 

 css:

.dialog-cont{float: right; width: 630px;height: 130px;margin-right: 10px;display:table;position: static;}
.dialog-stic{position: static;top: 50%;left: 0;display: table-cell;vertical-align: middle;}
.dialog-stic p{color: #fff;font-size: 14px;line-height: 25px;display: block;position: relative;top: -50%;left: 0;padding-right: 10px;text-align:left;text-indent: 2em;}

 

css 设置文本垂直居中

标签:

原文地址:http://www.cnblogs.com/yesw/p/4381660.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!