If I have a fixed sized container div, and an unknown sized image, how do I horizontally and vertically center it?
- using pure css
- using JQuery if css can't do it
This answer makes sense for fixed width images, but not variable ones.
Something like this structure (I have in mind item renderers similar to these in the list, but where the image on the left wouldn't always be the same size:
<ul id="gallery">
<li id="galleryItem1">
<div class="imageContainer">
<img src="gallery/image1"/>
</div>
<p>Some text to the right...</p>
<!-- more stuff -->
</li>
<li id="galleryItem2">
<!-- ... -->
</ul>
Thanks for the help!