Image size does not work in Mozilla and IE

advertisements

I have a code which works fine in Google Chrome but not working in Firefox and IE.

<asp:Image ID="Image1" runat="server" CssClass="image" />

Css Code :

.image{
 width:50px;
 height:50px;
 content:url('Image.png');
}
.image:hover{
 width:50px;
 height:50px;
 content:url('Image_Hover.png');
}


CSS:

.my-img{
          width:100px;
          height:100px;
          background-image: url('Image.png');
        }
     .my-img:hover {
            background-image: url('Image_Hover.png');
        }

HTML:

<div class="my-img"></div>

Try this.