div中的文本垂直居中

时间:2014-06-04 14:29:11

标签: html css twitter-bootstrap-3

我在div中有一个段落(bootstrap中的类行),我想在段落中垂直居中文本,但我似乎无法做到。这是我的代码和jsfiddle ......

<div class="container-fluid">
<div id="footer" class="row">
    <p id="text" >TEXT</p>
    <img id="facebook" class="img-responsive pull-right" src="http://placehold.it/59x57" style="margin-bottom:15px;margin-right:15px;margin-top:15px;">
    <img id="adresa" class="img-responsive pull-right" src="http://placehold.it/59x57"  style="margin-bottom:15px;margin-right:15px;margin-top:15px;">
    <img id="poruka" class="img-responsive pull-right" src="http://placehold.it/59x57"  style="margin-bottom:15px;margin-right:15px;margin-top:15px;">
    <img id="telefon" class="img-responsive pull-right" src="http://placehold.it/59x57"  style="margin-bottom:15px;margin-right:15px;margin-top:15px;">
</div>

http://jsfiddle.net/T8Pjh/3/

感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

JSfiddle Demo

#footer {
    background:pink; /* for visual reference */
    display: table;
    width:100%;
}

#footer p {
    display: table-cell;
    vertical-align: middle;
}