【发布时间】:2012-06-05 19:06:49
【问题描述】:
我正在为响应式博客网站使用两列布局。左列使用图像,该图像被缩放以填充列的宽度,右列包含从博客文章中提取的文本。
有什么想法可以限制右侧列中文本段落的高度以匹配左侧列中图像的高度,因为浏览器宽度减小?
我打算使用 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;
}
【问题讨论】:
-
仍然坚持这个 - 任何人都可以帮忙吗?以下解决方案似乎都不起作用?
标签: javascript jquery responsive-design css