Hi,
I want to display 3 random images on my homepage, each time it loads. They are all no more than 200px high or wide (depending on their orientation), but apart from that I cant be sure how high they are.
I have a container div which is 230x230 and has a background image of like a raised platform onto which I want the image to be placed. I can then center the image horizontally using text-align but i need some ideas on centering vertically. I know its never easy, but im hoping someone has a cheeky workaround i can use.
HTML:
<div class="sample">
<a href="search.php?indexfind=22" title="Click to view property information">
<img src="includes/image_processor.php?select=22" alt="EXAMPLE PROPERTY" title="Click to view" />
</a>
</div>
CSS:
.sample { width:230px; height:230px; display:block; float:left; background-image:url('../../images/box.jpg'); background-position:center center; background-repeat:no-repeat; text-align:center; }
.sample img { margin-top:15px; }
Thanks
Ryan