我正在为响应式博客网站使用两列布局。左列使用图像,该图像被缩放以填充列的宽度,右列包含从博客文章中提取的文本。
当浏览器宽度减小时,关于如何将右侧列中文本段落的高度限制为与左列中图像高度匹配的任何想法?
我打算使用 text-overflow: ellipsis 来处理右侧 div 中的文本溢出。
下图之前和之后的示例。
这是 HTML,以及我用来设置图像大小以在浏览器窗口缩小时调整大小的 CSS。
<div class="row blogpost">
<div class="sevencol">
<img src="img/greybox.png">
</div>
<div class="fourcol last>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.
</p>
<a class="readMore" href="#">Read More...</a>
</div>
.blogpost .sevencol img {
zoom: 2;
margin: auto;
height: auto;
max-height: 100%;
width: auto;
max-width: 100%;
margin-top: 8px;
}