0

type = image of input name = searchsel_listを使用すると、画像が正しく表示されますが、その検索をクリックすると表示したい結果が得られないため、type = submitを変更して、結果を取得しましたが、画像が表示されなくなりました

<div id="tabr"><form id="quick-search" action="csearch.php?epage=csearch"  method="post" >
<p>
<label for="qsearch">Search:</label>
<input class="tbox" id="qsearch" type="text" name="tsearch" placeholder="Search Selected Candidate" title="Type name and hit ENTER" />
<input type="submit" class="btn" alt="Search" name="searchsel_list" title="Search"  />
</p>
</form></div>

CSS

 #tabr form#quick-search {
    padding: 0; margin: 30px 0 0 30px;
    width: 270px; height: 33px;
    background: #fff url(../images/header-search.gif) no-repeat;
    border: none;   
}
#tabr form#quick-search p {
    margin: 0; padding: 0;      
    border: none;
}
#tabr form#quick-search input {
    border: none;
    background: transparent;
    color: #BABABA;
    margin: 0; padding: 5px;
    font-size: .9em;    
    float: left;        
}
#tabr form#quick-search .tbox {
    margin: 6px 0 0 5px;
    width: 220px;   
    display: inline;    
}
#tabr form#quick-search .btn{
    width: 24px; height: 24px;      
    margin: 5px 0 0 0;  padding: 0; 
}
#tabr form#quick-search label {
    display: none;
}

私はこれを試しましたが、これでも機能しません

<button type="submit" class="btn" alt="Search" name="searchsel_list" title="Search"><img src="images/header-search.gif" /></button>

どうすれば画像を再度表示できますか、ありがとうございます

4

1 に答える 1

1

私が見ているのは、フォーム自体の背景のみを指定し、送信には何も指定していないので、別のクラスを追加してください

<input type="submit" class="btn quickSubmit" name="searchsel_list" title="Search"  />

CSS

.quickSubmit {
    background-image: url(path/to/your/image);
        background-position:  0px 0px;
        background-repeat: no-repeat;
        width: add image width;
        height: add image height;
        border: 0px;
        text-indent: -9999px; /* this is to hide the submit buttons text */
}

編集:

申し訳ありませんが、btnクラスも削除して私の例に置き換えるか、btnクラスの状態を上記の例に変更してください。

于 2013-01-23T09:50:50.570 に答える