Reputation: 109
I want to be able to when the user hovers over the button the button image changes. Thanks
<input type="image" src="qmb.png" name="saveForm" class="btTxt submit" id="button" height="49.5px" padding = "0px"/>
#button {
text-align:center;
float:left;
}
#button:hover {
text-align:center;
float:left;
background-image: url('qmb2.png')
}
Upvotes: 1
Views: 811
Reputation: 9992
This should resolve the problem, remove the image from HTML input
<input type="image" name="saveForm" class="btTxt submit" id="button" height="49.5px" padding = "0px"/>
and put it here in CSS
#button {
text-align:center;
float:left;
background-image: url('qmb.png')
}
#button:hover {
text-align:center;
float:left;
background-image: url('qmb2.png')
}
Upvotes: 2
Reputation: 280
#button:hover {
background-image: url('qmb2.png')
}
also, on hover you don't need to repeat again all the properties
Upvotes: 1