Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
* {padding:0;margin:0;border:0}
.* {padding:0;margin:0;border:0}
table {border-collapse:collapse}
td {background-color:black;vertical-align:bottom}
div {background-color:red}
</style>
</head>
<body>
<table>
<tr>
<td><div>left</div></td>
<td><a href="test.html"><img alt="" height="20" src="image.gif" width="20" /></a></td>
<td><div>right</div></td>
</tr>
</table>
</body>
Does anyone know how to fix that?
You can learn more here:
Quirks mode vs. Standards mode [webmasterworld.com]
Hence we get a gap. Changing the <img> element to display:block fixes that particular issue, but then (on a standards compliant browser) the centering rules that work on inline elements are no longer applied.
I'm glad it's fixed for you.
When the first doc-type switching came out I paid very little attention to the comments and articles about it, for a while, at least. And then I got bit bad and had to do some serious study again. I'm sure the future will hold a few more similar surprises.