我有这个例子: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。
这可能吗?
我正在使用推特引导程序。