I have this example: 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;
}
I would like the caption of the image to be:
1. positioned over the image (in the top layer).
2. placed vertically in the bottom of the image.
3. with ellipsis.
4. will not get out of the wrapping div.
Is this possible?
I am using twitter bootstrap.
I would do that with position: relative; and position: absolute;, like so:
Regarding the ellipsis, then you can add this:
…after the text. Was that what you meant?