0

I've designed how my buttons would look in an external app and saved it as an image to use for my webpage, and I want to code the webpage so that when I hover over the button, it changes to the image of the button I've designed - is there a method to do this with html.css?

the current html code:

    <div class = 'comment'>
        <a href = "hidden_comments.html">
        <img src='commentbar.jpg', width=90px>
    </div>

the css code:

.comment{
    display: inline;
    margin-left: -10px;
}
Amy sdj
  • 47
  • 7

2 Answers2

0

Yes it's possible. have :hover as selector on the element in css. And add background-image part of css, for example below:

div:hover{
  background-image: url("paper.gif");
}
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Asutosh
  • 1,775
  • 2
  • 15
  • 22
0

It is not recommended to use CSS hover to do it. You may want to change image dynamically and you can not do it with CSS.

Here you can find an exact solution

ramilabbaszade
  • 62
  • 2
  • 11