更新:答案让我很接近,但由于文本 div 较大,它们仍然不能垂直对齐,我怎样才能使它们都具有相同的高度并因此对齐?
我想要两个相邻的 DIV,一个包含图像,一个包含文本,都位于容器 DIV 中。
图像应该是容器 div 宽度的 15%,文本使用剩余的 85%
图像和文本应在各自的 DIV 中垂直对齐,因此看起来它们彼此对齐。
我试图解决这个问题,但似乎做不到!任何人都可以帮忙吗?
#picture {
float: left;
width: 15%;
line-height: auto;
}
#text {
width: auto;
padding-left: 16%;
line-height: auto;
vertical-align: middle;
margin-top: auto;
margin-bottom: auto;
}
#text p {
display: inline-block;
vertical-align: middle;
line-height: normal;
}
和
<div id="quotes">
<div id="picture">
<img style="width: 100%; vertical-align: middle" src="tom.jpg" >
</div>
<div id="text">
<p>"Christiaan was one of the stand out candidates throughout, therefore there was no hesitation in offering him a place on this highly sort after scheme..."</p>
</div>
</div>