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>
<html>
<body>
<div style="height: 5cm; width: 100%; background: #ddd>
<img src="my.jpeg" />
</div>
</body>
</html>