Change image of freeze send button

I have the following in an html form using the Post method.

<input type="submit" title="" class="myclass" value="" />

and:

.myclass {
background: url(../images/image1.png)  no-repeat; border: none;
width: 165px;
height: 59px;
}

Basically, I need my information about the form, which will be published using the image1.png button, and image2.png will be called when it hangs. Would you recommend CSS or javascript, and what would be the exact way to do this?

Thanks to everyone, answered!

+3
source share
3 answers

Submit Button:

<input type="image" title="" class="myclass" src="../images/image1.png" />  

CSS

.myclass:hover {
background: url(../images/image2.png)  no-repeat; border: none;
width: 165px;
height: 59px;
}
+7
source

If you can use jquery look at this

Events / hover

+3
source

, , , :

<input type="image" class="myclass" src="../images/image1.png" />

CSS

.myclass, .myclass:hover {
width: 165px;
height: 59px;
}
.myclass {
background: url(../images/image1.png);
}
.myclass:hover {
background: url(../images/image2.png);
}
+1

Source: https://habr.com/ru/post/1725926/


All Articles