![]() |
Bootstrap中如何让响应式图片(img-responsive)水平居中
我们在用bootstrap排版内容的时候,有的时候在内容中需要图片水平居中对齐。
一般情况下,我们的图片都使用了 .img-responsive 类来实现响应式图片。如果需要实现响应式图片水平居中,那么我们要使用 .center-block 类,不要用 .text-center 通过 .center-block 类 实现响应式图片水平居中使用方法: Code:
<p><img class="img-responsive center-block" src="..." /></p>Code:
<p class="center-block"><img class="img-responsive" src="..." /></div>Code:
<p class="text-center"><img src="..."></p> |
| All times are GMT +8. The time now is 08:54 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.