Possible Duplicate:
Aligning image to center inside a smaller div
I have a problem which points to CSS 3. Please see the part of my HTML code:
<div id="main" style="width: 320px; height: 400px;">
<img src="test.jpg" height="400" />
</div>
I don't know the real sizes of the test.jpg file (width can be different - the file is dynamic). I want to have the image in the middle of id="main" (I don't care, that the left & right part of the image will be out of range - it's even better). How can I do that ?