我想我已经得到了你需要的东西。请看这里:https ://jsfiddle.net/an1gsdm0/
我将整行包裹在table-row中。图像和文本是其中的表格单元格。文本的表格单元格有inline-block div,里面有文本。您可以通过操作 .image 类大小来测试它。然后文本字段高度将调整。这是代码:
HTML:
<div class="container">
<div id='first' class='img-div'>
<img class="image" src='http://png-4.findicons.com/files/icons/2141/web_design_creatives/128/small_smile.png'/>
</div>
<div class="outer-text">
<div id='second' class='text-div'>Put a long text here...
</div>
</div>
</div>
CSS:
.container{
display: table-row;
}
.img-div {
display: table-cell;
float: left;
}
.outer-text{
display: table-cell;
height: 100%;
width: 190px;
}
.text-div{
display: inline-block;
height: 100%;
overflow-y: auto;
}
要针对自定义的各种图像尺寸对其进行测试,请更改图像的高度:
.image{
height: 190px;
}