【发布时间】:2012-10-24 04:24:47
【问题描述】:
我有这个例子:http://jsfiddle.net/WkpL9/
HTML:
<div class="span2">
<div class="image-container">
<img alt="" src="http://placehold.it/150x120"/>
<p>asdadsadasdasdsadasdasdasdasdsadsad</p>
</div>
</div>
CSS:
.image-container {
position: relative;
margin-left: auto;
margin-right: auto;
width: 100%;
}
.image-container img {
max-height: 150px;
}
.image-container p {
white-space: nowrap;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
bottom: 0px;
}
我希望图片的标题是: 1. 定位在图像上(在顶层)。 2.垂直放置在图像的底部。 3.用省略号。 4.不会跳出包裹的div。
这可能吗?
我正在使用 twitter 引导程序。
【问题讨论】:
标签: html css twitter-bootstrap