我有一段可响应的代码,我想将图像垂直和水平居中。有人可以帮助我解决这个令人困惑的难题吗?

<div class="row">
<div class="col-xs-4"><a href="http://dreamatico.com/data_images/banana/banana-5.jpg" target="_blank" title="Read More"><img src="http://dreamatico.com/data_images/banana/banana-5.jpg" /></a></div>
<div class="col-xs-4"><a href="http://dreamatico.com/data_images/banana/banana-5.jpg" target="_blank" title="Read More"><img src="http://dreamatico.com/data_images/banana/banana-5.jpg" /></a></div>
<div class="col-xs-4"><a href="http://dreamatico.com/data_images/banana/banana-5.jpg" target="_blank" title="Read More"><img src="http://dreamatico.com/data_images/banana/banana-5.jpg" /></a></div>

最佳答案

尝试这个

.col-xs-4 {
        display: table-cell;
        float: none;
        vertical-align: middle;
    }

关于html - Bootstrap Div标签内的绝对中心图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34668996/

10-10 18:46