Forum How do I...?

Centering an image within a box with fixed dimension

yet
I want to vertically and horizontally center an image with a DIV with fixed dimensions. I tried various approaches how you would do it with CSS in browser but no luck...is there a suitable solution?

<html>
<body>
<div style="height: 5cm; width: 100%; background: #ddd>
<img src="my.jpeg" />
</div>
</body>
</html>
mikeday
Put it in a table cell with fixed height and vertical align middle?