垂直对齐img in row - twitter bootstrap

时间:2013-11-05 17:09:51

标签: html css twitter-bootstrap

我在Twitter Bootstrap 3中使用img vertical align时遇到了一些问题。所以,这是HTML:

<div class="container center-block">
        <div class="row slider">
            <div class="col-md-1 left-arrow"><img src="img/left-arrow.png"/></div>
            <div class="col-md-2 brand"><img src="img/brand.png"/></div>
            <div class="col-md-2 brand"><img src="img/brand.png"/></div>
            <div class="col-md-2 brand"><img src="img/brand.png"/></div>
            <div class="col-md-2 brand"><img src="img/brand.png"/></div>
            <div class="col-md-2 brand"><img src="img/brand.png"/></div>
            <div class="col-md-1 right-arrow"><img src="img/right-arrow.png"/></div>
        </div>
    </div>

如何在.left-arrow.right-arrow div中垂直居中图像?感谢

1 个答案:

答案 0 :(得分:0)

检查此css

    .container .row { float:left; width:100%; }
    .container div { float:left; }
    .left-arrow { margin-right:10px; }
    .right-arrow { margin-left:10px; }