使图像响应地扩展到与文本相同的大小
我现在正在在Shopify网站上工作,希望图像以与文本相同的规模扩展。目前看起来像这样: 图像如何大于文本的图像
这是我使用的代码。
<div class="bulky-img-section-right">
{%else%}
<div class="bulky-img-section">
{%endif%}
<div class="image-sub-section">
<img class="is-image" src="{{section.settings.image-link | img_url:'master'}}" alt="{{section.settings.image-link}}" />
</div></div>
CSS
.bulky-img-section
{
display: flex;
flex-direction: row;
width: 100%;
}
.bulky-img-section-right
{
display: flex;
flex-direction: row-reverse;
width: 100%;
}
.image-sub-section
{
width: 50%;
padding: 3rem;
}
预先感谢。
I'm working on a Shopify site right now and I want the image to scale at the same size of the text. Currently it looks like this:
Image of how the image is larger than the text
This is the code that I'm using.
<div class="bulky-img-section-right">
{%else%}
<div class="bulky-img-section">
{%endif%}
<div class="image-sub-section">
<img class="is-image" src="{{section.settings.image-link | img_url:'master'}}" alt="{{section.settings.image-link}}" />
</div></div>
CSS
.bulky-img-section
{
display: flex;
flex-direction: row;
width: 100%;
}
.bulky-img-section-right
{
display: flex;
flex-direction: row-reverse;
width: 100%;
}
.image-sub-section
{
width: 50%;
padding: 3rem;
}
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以以一定的绝对位置进行操作,这是我认为从正常流中删除图像的唯一方法。
You can do it with some absolute position, only way I can think to remove the image from the normal flow.