如何使用 bootstrap 3 使带有背景图像的 div 响应??
是否可以在 bootstrap 3 中使用 img-responsive 类??
我的 div 是空的,如下所示:
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="workflowstep workflowstep1 img-responsive">
</div>
<div class="workflowstep workflowstep2 img-responsive">
</div>
<div class="workflowstep workflowstep3 img-responsive">
</div>
<div class="workflowstep workflowstep4 img-responsive">
</div>
<div class="workflowstep workflowstep5 img-responsive">
</div>
<div class="workflowstep workflowstep6 img-responsive">
</div>
</div>
</div>
最佳答案
我认为使用 img-responsive
并非如此在这里,因为它是 <img />
并制作 div
背景图片响应式,我们可以使用background-size: cover;
background-size: cover;
Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area
关于javascript - 使用 bootstrap 3 使 div 背景图像响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19752749/