2010-06-09 53 views
1

餘米試圖一類適用於以下提交按鈕 代碼:類不申請提交按鈕

<input type="submit" value="Submit" name="commit" class="confirm-button-submit "> 

CSS:

.confirm-button-submit 
{ 
    width : 79px; 
    font  : bold 12px sans-serif;; 
    color : #000; 
    background : url("../images/confirm-btn.png") 0 -33px no-repeat; 
    text-decoration : none; 
    margin-top :0px; 
    text-align:center; 
    border:0px; 
    cursor : pointer; 
    height:170px; 
} 


.confirm-button-submit a 
{ 
    width : 79px; 
    font  : bold 12px sans-serif;; 
    color : #000; 
    background : url("../images/confirm-btn.png") 0 -33px no-repeat; 
    text-decoration : none; 
    margin-top :0px; 
    text-align:center; 
    border:0px; 
    cursor : pointer; 
    height:170px; 
} 



.confirm-button-submit a:hover 
{ 
    width : 79px; 
    font  : bold 12px sans-serif;; 
    color : #000; 
    background : url("../images/confirm-btn.png") 0 0 no-repeat; 
    text-decoration : none; 
    margin-top :0px; 
    text-align:center; 
    border:0px; 
    cursor : pointer; 
    height:170px; 
} 

但它不是正確的工作該怎麼做

謝謝

+0

一旦你設置了類名,什麼工作不正常? – 2010-06-09 16:41:51

回答

1

我假設你打算使用CSS規則.confirm-button-submit申請,但你的按鈕沒有這個類。

你不得不使用:

<input type="submit" value="Submit" name="commit" class="confirm-button-submit" /> 
0

您的代碼不會有一個類。

<input type="submit" value="Submit" name="commit" class='confirm-button confirm-button-submit'> 

編輯 —以及一組的問題可能是你要設定CSS屬性,一個<input type='submit'>元素只是不支持。我懷疑如果你在Firebug DOM檢查器中查看你的<input>元素,你可能會看到你所有的CSS類,但是你也會看到它們實際上沒有任何效果。

+0

對不起,我用它,但忘記寫在代碼中 – Mayur 2010-06-09 16:38:00