gpt4 book ai didi

javascript - 使用 bootstrap 3 使 div 背景图像响应

转载 作者:太空狗 更新时间:2023-10-29 16:51:38 27 4
gpt4 key购买 nike

如何使用 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">&nbsp;
</div>
<div class="workflowstep workflowstep2 img-responsive">&nbsp;
</div>
<div class="workflowstep workflowstep3 img-responsive">&nbsp;
</div>
<div class="workflowstep workflowstep4 img-responsive">&nbsp;
</div>
<div class="workflowstep workflowstep5 img-responsive">&nbsp;
</div>
<div class="workflowstep workflowstep6 img-responsive">&nbsp;
</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 cancompletely cover the background positioning area

关于javascript - 使用 bootstrap 3 使 div 背景图像响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19752749/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com