麻烦使一排图像响应迅速
我只想制作一排响应迅速的图像。首先,我想将图像的大小减少20%。无论出于何种原因,我都无法正常工作。我正在使用Bundler Vite BTW,必须将图像源存储在CSS中,例如代码中的此处。
<div class="business">
<img class="firstb" alt="firstb">
<img class="secondb" alt="secondb">
<img class="thirdb" alt="thirdb">
<img class="fourthb" alt="fourthb">
<img class="fifthb" alt="fifthb">
</div>
.business {
margin: 0 7em;
display: flex;
}
.firstb {
content:url(./img/business/firstb.png);
}
.secondb {
content:url(./img/business/secondb.png);
}
.thirdb {
content:url(./img/business/thirdb.png);
}
.fourthb {
content:url(./img/business/fourthb.png);
}
.fifthb {
content:url(./img/business/fifthb.png);
}
I just want to make a row of images that are responsive. To begin with though I want to reduce the size of the images by 20%. For whatever reason I can't get this to work. I am using the bundler Vite btw and have to store the source of the image in the css like here in the code.
<div class="business">
<img class="firstb" alt="firstb">
<img class="secondb" alt="secondb">
<img class="thirdb" alt="thirdb">
<img class="fourthb" alt="fourthb">
<img class="fifthb" alt="fifthb">
</div>
.business {
margin: 0 7em;
display: flex;
}
.firstb {
content:url(./img/business/firstb.png);
}
.secondb {
content:url(./img/business/secondb.png);
}
.thirdb {
content:url(./img/business/thirdb.png);
}
.fourthb {
content:url(./img/business/fourthb.png);
}
.fifthb {
content:url(./img/business/fifthb.png);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该给Flexbox的子元素一个宽度:
You should give the child elements of a flexbox a width: