[英]How to make image scale to full width on bootstrap column after transition to mobile view
I'm struggling with making the image on the right stretch to full width in a moment when you'll make the screen size smaller so it transitions to mobile view. 当您要缩小屏幕尺寸以使其过渡到移动视图时,我正努力使图像在正确的方向上拉伸到全宽。 Is there any other class in bootstrap that would do similar work that "img-fluid" does but display image full width when it goes below the text in bootstrap grid system?
引导程序中是否还有其他类可以做与“ img-fluid”类似的工作,但是当图像低于引导程序网格系统中的文本时,会显示全角图像?
<div class="row">
<div class="col-md-6 d-flex">
<div class="align-self-center">
<p class="lead font-weight-bold">sometext</p>
</div>
</div>
<div class="col-sm-6">
<img class="img-fluid" src="someimage.jpg">
</div>
</div>
Here is my fiddle: http://jsfiddle.net/x1hphsvb/2220/ To see what I mean simply lower the width of display window. 这是我的小提琴: http : //jsfiddle.net/x1hphsvb/2220/要了解我的意思,只需减小显示窗口的宽度。 Image goes below the text and fills only half of the div when I want it to fill it fully and behave as it does right now before the transition.
图像位于文本下方,并且仅填充div的一半时(我希望它完全填充并且在过渡之前就表现出来)。
Both the columns should have the same breakpoint (ie; md
/ sm
) so that they become full-width at the same time... 两列都应具有相同的断点(即
md
/ sm
),以便它们同时变为全角...
<div class="row">
<div class="col-md-6 d-flex">
<div class="align-self-center">
<p class="lead font-weight-bold">sometext</p>
</div>
</div>
<div class="col-md-6">
<img class="img-fluid" src="someimage.jpg">
</div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.