td のプレーン テキストと td のボタン値のテキストを揃えるために、css の詳細を定義して、任意の種類のブラウザー、または少なくともほとんどのブラウザーで揃えるようにしたいと考えています。
以下は私の試行と、IE9/8/7 と Chrome でのレンダリングの違いです。ご覧のとおり、与えられた html は IE9 では問題ないように見えますが、IE8/IE7 と Chrome は間違っています。パディングを (テキスト td に直接、またはテキスト td に追加された div に) 追加しても、IE9 が間違っているため、これは解決されません。
では、すべてのブラウザーでプレーン テキストとボタンの値のテキストが適切に配置されるようにするには、どの CSS 定義を使用する必要があるのでしょうか?
html:
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
table {
border: solid black 1px;
border-collapse: collapse;
padding: 0;
border-spacing: 0;
}
td {
border-style: dotted solid none none;
border-color: black;
border-width: 1px;
padding-left: 5px;
padding-right: 5px;
padding-top: 0px;
padding-bottom: 0px;
font-style: normal;
font-family: Verdana;
font-size: 12px;
vertical-align: top;
}
input.example {
color: blue;
background: white;
padding-top:1px;
padding-left:0px;
border: 0px;
outline:0;
font-size: 12px;
cursor: pointer;
}
</style>
</head>
<body>
<p/>
<table>
<tbody>
<tr>
<td>EXAMPLE</td>
<td><input type="button" class="example" value="EXAMPLE"></td>
</tr>
Chrome
</tbody>
</body>
</html>