2010-06-09 52 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