css 设置文本垂直居中

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;}
原文地址:https://www.cnblogs.com/yesw/p/4381660.html