搜索图像无法正常显示

时间:2013-01-23 08:42:00

标签: html css

当我使用输入名称= searchsel_list的type = image比我正确显示图像时,但是我没有得到我希望在该搜索中显示的结果,所以我改变了它的类型=提交所以我得到了结果但现在图像没有显示

<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>

如何再次显示图像,谢谢

1 个答案:

答案 0 :(得分:1)

我看到你只为自己的表单指定了一个背景,没有任何提交,添加一个nother类

示例

<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班级状态