我有一张图片溢出了我的行。我在网上看到 clearfix 可以防止这种情况发生。但是应用这个之后,我的图像看起来像一条非常细的线,几乎看不到任何东西。我的代码在下面可见。如何确保我的图像在此容器内动态调整自身大小?
<div class="row">
<div class="col-sm-2 col-md-2 col-lg-2">
<img src="url" alt="A picture" id="heading-img" class="img-responsive">
</div>
<div class="col-sm-6 col-md-6 col-lg-6 col-sm-offset-2 col-md-offset-2 col-lg-offset-2">other things</div>
</div>
最佳答案
如果您使用的是 bootstrap css,请添加 class="img-responsive"。
关于css - Bootstrap 图像不会按行动态调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32375060/