bootstrap响应式图片

2020-07-14  本文已影响0人  Ancestor楠

响应式图片 img-responsive

等比例缩放

网址:https://v3.bootcss.com/css/#images

在 Bootstrap 版本 3 中,通过为图片添加 .img-responsive 类可以让图片支持响应式布局。其实质是为图片设置了 max-width: 100%;、 height: auto; 和 display: block; 属性,从而让图片在其父元素中更好的缩放。

如果需要让使用了 .img-responsive 类的图片水平居中,请使用 .center-block 类,不要用 .text-center。

栅格12-3+9
上一篇下一篇

猜你喜欢

热点阅读