Dealing with an unchangeable piece of HTML can be frustrating, especially when it comes to styling. In my case, I have the following structure:
<a title="some title" href="...">
<img src="....jpg"></img>
Some text
</a>
Here is the current CSS in place:
div.container-outer {
width: 25%;
float:left;
}
div.container-inner {
width: 156px;
margin: 5px;
}
div.container-inner img {
max-width: 156px;
max-height: 124px;
}
My goal is to center the text under the image and have both elements centered within a fixed-width containing div. The dimensions of the images are unpredictable, but there are max-width and max-height constraints to consider. Additionally, I want the bottom of the picture to stay at a fixed position inside the containing div.
I am open to modifying the surrounding HTML code if necessary. Any suggestions on how to achieve this layout would be greatly appreciated!
Best Regards, Markus
edit 130513 ------------------------------------------------
After experimenting with the current CSS provided above, I am still unable to achieve the desired layout. The image remains left-aligned, causing the text below to also align to the left. Furthermore, any changes in image height result in fluctuations in the positioning of the lower part of the image due to its top alignment.