Html 图像未调整大小(仅限默认 Bootstrap 类)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18763719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Images not resizing (default Bootstrap classes only)
提问by user13176
I am using Bootstrap 3.0 dist and I am following some Bootstrap tutorial now, trying to learn how it works. I did everything exactly as in the tutorial (it is for v2, so I changed the classes to v3) and I do not use any custom CSS or anything and in the tutorial the images resize when you simply resize the window, but in mine it stays same and wrecks everything. Also according to the tutorial images should stay centered inside the boxes (the 3 images).
我正在使用 Bootstrap 3.0 dist,我现在正在学习一些 Bootstrap 教程,试图了解它是如何工作的。我完全按照教程中的所有内容(它适用于 v2,所以我将类更改为 v3)并且我不使用任何自定义 CSS 或任何东西,并且在教程中,当您简单地调整窗口大小时,图像会调整大小,但在我的保持不变并破坏一切。此外,根据教程图像应保持在框内居中(3 个图像)。
回答by ashwinm
In bootstrap 3 Images are no longer responsive by default. Use .img-responsivefor fluid size.
在 bootstrap 3 中,默认情况下图像不再响应。使用.img-responsive来确定流体尺寸。
Doc:http://getbootstrap.com/getting-started/#migration-dropped
文档:http: //getbootstrap.com/getting-started/#migration-dropped
回答by CeeGee
Have you tried adding class="img-responsive" to the problematic images? Best regards, Cara
您是否尝试将 class="img-responsive" 添加到有问题的图像中?最好的问候,卡拉