「input」タグの「submit」ボタンを画像にかえる方法

この記事は公開から1年以上経過しており、内容が古くなっている可能性があります。

<input type=”submit” class=”button” value=”検索” />

というようなボタンを画像に差し替える場合、このようにスタイルを設定します。

input.button{
 background-image:url(“images/search_button.png”);
 background-repeat:no-repeat;
 background-color:#000000;
 border:none;
 width:28px;
 height:28px;
 text-indent: -9999px;
 cursor: pointer;
}

サンプル [新しいウィンドウで開く]

コメント

  1. JOYE より:

    Good day! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us useful information to work on. You have done a wonderful job!

タイトルとURLをコピーしました