html - flex 图像行在没有包装器的情况下收缩
问题描述
我如何制作高度为 100px 的 flex 1 行;无包装;图像缩小;没有包装任何 img 标签;允许使用对象拟合;图像可以是任意大小;如果图像高度小于 100 像素,则不按高度分层(参见最后一张图片)
<div class="row">
<img src="https://res.cloudinary.com/1.jpg" >
<img src="https://res.cloudinary.com/2.jpg" >
<img src="https://res.cloudinary.com/3.jpg" >
</div>
.row{
height: 100px;
width: 500px;
display: flex;
}
.row img {
object-fit: cover;
flex-shrink: 1;
}
期望的结果:
如果更多图片
解决方案
推荐阅读
- javascript - 输入字母时如何使图像出现?
- java - NetBeans:java.lang.ClassNotFoundException:org.apache.derby.jdbc.ClientDriver 访问 JSP 页面
- java - 如果包含特殊符号,Linux 命令无法使用 java
- html - gltf 文件未在 Aframe 中显示
- javascript - 此处 Maps API JavaScript 以边距放大边界
- python - Python 3 中的分布
- sql - PostgreSQL 中 INNER JOIN 中字段的总和
- ruby-on-rails - 无法从规范中的 API 检索记录
- amazon-web-services - 从 Jenkins CI/CD 推送到存在于不同 AWS 账户中的 ECR
- javascript - 如何在标头中传递令牌并在 cs 中检索值