<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-md-4"><br><br><img src="images\smartphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Smart Phone</h4></div>
<div class="col-md-4"><br><br><img src="images\oldphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Basic Phone</h4></div>
<div class="col-md-4"><br><br><img src="images\tab.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Tablet</h4></div>
</div>
</div>
&#13;
缩略图图像未与中心对齐。但是文本与中心对齐。图像左对齐。是否有解决方案?
答案 0 :(得分:1)
请使用 flex :
尝试以下代码.imager div{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
<div class="container-fluid">
<div class="row imager">
<div class="col-md-4"><br><br><img src="images\smartphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Smart Phone</h4></div>
<div class="col-md-4"><br><br><img src="images\oldphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Basic Phone</h4></div>
<div class="col-md-4"><br><br><img src="img-circle" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Tablet</h4></div>
</div>
</div>
答案 1 :(得分:0)
.col-md-4 {
text-align:center;
}
<div class="container-fluid">
<div class="row">
<div class="col-md-4"><br><br><img src="images\smartphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Smart Phone</h4></div>
<div class="col-md-4"><br><br><img src="images\oldphone.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Basic Phone</h4></div>
<div class="col-md-4"><br><br><img src="images\tab.png" class="img-circle" alt="" width="243" height="241" align="middle"><br><h4 style="color:#1E7145" align="center">Tablet</h4></div>
</div>
</div>