表のセル内に簡単な検索フォームを作成したい:
<td style="vertical-align: center">
<div id="search">
<form action="search" method="get">
Search:
<input type="text" value="enter something" class="autoempty" />
<button type="submit"></button>
</form>
</div>
</td>
ボタンには、次の CSS を使用して検索アイコンがあるはずです。
div#search button {
/*reset the normal button behavior*/
padding: 0px;
border-width: 0px;
border-style: none;
background-color: transparent;
/*Make it square*/
width: 30px;
height: 30px;
/*set background*/
background-image: url("../images/search_grey.png");
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
/*fancy cursor*/
cursor: pointer;
}
これは次のようになります。
色は、Firebug によって表示される要素の寸法を示しています。水色が<td>
エレメントです。
プロパティがそれを修正することを望みvertical-align
ましたが、そうではありませんでした。<img>
テキストにタグを追加する際にも同じ問題がありました。