html - 图像和容器 div 以不正确的宽度呈现
问题描述
我在 div 中嵌入了一个图像,如下所示,但是,div 以不正确的宽度呈现(在 MacOS 上的 Safari 中进行测试)。d
当我使用margin-left
of删除 div 时,问题似乎自行解决了20px
。
.a {
width: 75px;
height: 75px;
}
.b {
width: 100%;
height: 100%;
border-radius: 10px;
}
.c{
display: flex;
flex-direction: row;
width: -webkit-fill-available;
}
.d {
display: flex;
flex-direction: column;
width: -webkit-fill-available;
margin-left: 20px;
}
.e {
display: flex;
flex-direction: row;
-webkit-box-pack: justify;
justify-content: space-between;
}
<div class="e">
<div class="c">
<div class="a"><img src="https://minimalistbaker.com/wp-content/uploads/2019/07/EASY-1-Pot-Massaman-Curry-Basic-ingredients-BIG-flavor-lots-of-protein-options-for-vegan-vegetarian-and-meat-eaters-plantbased-glutenfree-curry-massaman-recipe-minimalistbaker-34.jpg" class="b"><div class="d"></div></div></div></div>
解决方案
推荐阅读
- python - Pandas 数据框将列与一个值进行比较,并将这一行和上一行放入另一个数据框
- python - 无法在命令“python manage.py runserver”上看到 Django 默认页面
- java - 如何使用 HttpsURLConnection 发送 cookie
- redis - 如何使用 redis sentinel 配置 Airflow Celery 执行器?
- swift - SwiftUI:如何在 ForEach 循环中放置一个换行符,它在其中重复一个视图
- android - 在 Kotlin Lambda 中修改局部变量
- python - 过滤包含日期字符串的列表
- html - 使用 flex 作为显示,并有一个视频作为孩子不尊重我的填充设置
- php - 从 PHP JSON 响应中获取单个字段
- swift - 将Button标签名称取为UILongPressGestureRecognizer,更改var并返回值为Button的标签