我有一个像这样的简单表格:
<section class="subscribe" title='Lorem Ipsum'>
<form class="form-wrapper cf" method="post">
<input class="tiptipNewsletterInfo" id="emailInputText" name="email" placeholder="Enter your email here..." />
<button class="showforDesktopsOnly" id="submitBtnForDesktop" type="submit">Subscribe</button>
</form>
</section>
现在,我想更改鼠标悬停在提交按钮上时显示的背景图像。为此,我尝试使用以下 CSS,但它不起作用:
.form-wrapper #submitBtnForDesktop {
background: url("http://i.imgur.com/ANkUR4e.png") no-repeat 0 0 transparent;
transition: background-image 0.5s;
}
.form-wrapper #submitBtnForDesktop:hover {
background: url("http://i.imgur.com/ANkUR4e.png") no-repeat 0 -28px transparent;
}
我目前正在transition: background-image 0.5s;
其他地方使用鼠标悬停时更改其他背景图像,但在这种情况下它不起作用。
有谁知道为什么?
JSFiddle:http: //jsfiddle.net/ahmadka/49nzM/