我在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>
感谢任何帮助!
答案 0 :(得分:1)
#footer {
background:pink; /* for visual reference */
display: table;
width:100%;
}
#footer p {
display: table-cell;
vertical-align: middle;
}