- Joined
- Dec 10, 2004
- Messages
- 1,053
- Reaction score
- 0
I'm having a bit of trouble vertically centering an image (preferrably with CSS) on a page.
Example:
This will properly show the image as vertically centered. However, when a DOCTYPE is added (I've tried the doctypes for XHTML and 4.01 Transitional) it no longer centers.
Any suggestions on this?
Example:
Code:
<html>
<head>
<style type="text/css">
.centerme {
vertical-align: middle;
}
</style>
</head>
<body>
<table border="0" height="100%">
<tr>
<td>
<img src="myimage.jpg" class="centerme" />
</td>
</tr>
</table>
</body>
</html>
This will properly show the image as vertically centered. However, when a DOCTYPE is added (I've tried the doctypes for XHTML and 4.01 Transitional) it no longer centers.
Any suggestions on this?