FREN : image with caption
I had an image and wanted to put a caption centered below the image. The img was floated right by css selector for class "feature_publication_image". The img element has no caption attribute, I didn't want to use a table and table caption in the XHTML and similarly didn't want to use css display: table-cell and display: table-caption, so ended up creating this xhtml structure:
<div class="feature_publication_image"><img ... /><p>Caption</p></div>
and then modifying the css from this:
img.feature_publication_image {
float:right;
padding-right: 1em;
padding-left: 0.5em;
}
to this:
img.feature_publication_image , div.feature_publication_image {
float:right;
padding-right: 1em;
padding-left: 0.5em;
}
div.feature_publication_image p {
text-align:center;
}