【发布时间】:2019-01-18 21:08:18
【问题描述】:
我需要帮助使 div 与它旁边的 img 在同一 flex 行中的高度相同
这里是html
`<div class="about">
<img class="headshot" src="../img/headshot.jpg">
<div class="textbox">here is where my text is</div>
<div>`
我希望 .textbox 的大小与 .headshot 的高度和宽度相同。到目前为止,我的宽度相同,但我无法使高度相同。
这是css:
`.about {
display: flex;
justify-content: center;
align-items: flex-start;
text-align: center;
}
.headshot {
max-height: auto;
max-width: 25%;
}
.textbox {
background-color: hotpink;
width: 25%;
height: auto;
}`
我确信这是一些简单的解决方案,但我一直在努力解决它,所以非常感谢任何帮助! :)
【问题讨论】:
标签: flexbox resize alignment responsive sizing