Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>Demo page</title>
<style type="text/css">
input
{
border: 1px solid blue;
padding: 0px;
margin: 0px;
display: inline-block;
}
td
{
border: 1px solid red;
padding: 0px;
margin: 0px;
height: 20px;
max-height: 20px;
}
</style>
</head>
<body>
<form method="get" action="">
<table cellspacing="0" cellpadding="0" style="width: 100%">
<tr>
<td>
<input type="image" style="width: 20px; height: 20px" src="myimg_20x20.png" alt="20x20px"/>
</td>
</tr>
</table>
</form>
</body>
</html>
And here's the screenshot:
This has been tested on IE8, and it appears both in IE7 mode, and in IE8 mode with IE7 standards mode. This does not appear in IE8 mode with IE8 standards. Other browsers (at least Opera and FF) do not show such a behavior.
Where does the bottom gap come from and why cannot I get rid of it no matter how many height: 20px
and max-height: 20px
I add?