Zurb's Foundation と協力してレスポンシブ Web サイトを作成していますが、検索フォームをレスポンシブにしようとすると問題が発生しました。
入力フィールドがあり、その右側に<button>
フォームを送信します。ボタンには幅 70px の画像があります。したがって、入力フィールドに残りの 100% を占めるようにする必要があります。
私はoverflow: hidden;
あまり運がない方法を見てみました。パーセンテージを使用してみましたが、モバイル サイズにすると、サイズ変更 (基盤の一部) のためにボタン イメージが非常に小さくなります。
ここに私が持っているものがあります:
HTML:
<div class="form-search">
<input id="search" type="text" class="input-text" />
<button type="submit" class="button expand postfix">
<img src="images/search-submit.png" />
</button>
</div>
CSS:
div.form-search { overflow: hidden; }
div.form-search input { float:left; overflow: hidden; background: #ebebe7; border: none; padding: 1em; outline: none; }
div.form-search button { display: block; background: none; border: none; padding: 0; margin: 0; }