2011-07-04 24 views
0

的index.html與形式:如何使用CSS在窗體內動畫按鈕?

<form id="mc-embedded-subscribe-form" class="validate" name="mc-embedded-subscribe-form" method="post" action="mailing.php"><pre> 
<fieldset> 
<div class="mc-field-group"> 
<div class="input-cont"> 
<input id="email" class="required email input-text example" type="text" name="email" value="Your email address" onfocus="value=''" style="color: rgb(178, 178, 178);"> 
</div> 
</div> 
<div class="submit-cont"> 
<input id="submit" class="input-submit" type="submit" name="subscribe" value=""> 

CSS現在:

#content form #submit { 
    background: url("../img/join-button.png") no-repeat left top; 
    border: 0 none; 
    color: #221505; 
    cursor: pointer; 
    float: right; 
    font-size: 23px; 
    font-weight: 800; 
    height: 46px; 
    outline: 0 none; 
    position: relative; 
    top: 1px; 
    width: 102px; 

如何在這種情況下,指定一個:懸停和:積極性和更改背景圖片,因爲我不在我的HTML中有任何值或有沒有更好的方法來做到這一點?謝謝。

+0

你能提供的HTML? –

回答

0

這應該工作

#content form #submit:hover { 
    background-image: ... 
} 

#content form #submit:active { 
    background-image: ... 
} 
+0

試過這些:#content form #submit:hover { background-image:url(「../ img/join-button.png」)no-repeat left top; } #content form #submit:active { background-image:url(「../ img/join-button.png」)no-repeat left bottom ;.不知何故,它也不工作。附:當然,我爲此創造了雙重照片。 – funguy

+0

解決了。謝謝!剛剛從背景圖像更改爲背景 – funguy