Background image with CSS on Hover effect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rupak
    New Member
    • Jan 2008
    • 25

    Background image with CSS on Hover effect

    I have an mouseover effect with css on hover, which change the image on hover through Css.

    It works with IE fine but have problem with Mozilla, as the background image not coming full on hover. If i add padding-top:10px; in Css it comes fine with Mozilla but IE padding is to much.

    Can you help me with the same
    Code:
    a
    {
    background-image: none;
    padding: 10 0 0 0;
    height:24px;
    }
    a:hover
    {
    background-image: url(../images/start_1.gif);
    background-repeat: no-repeat;
    }
    <td class="change"><a href="#"><img id="imgname" border="0" src="images/start_on.gif" /></a></td>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    I think what you really want to do is have your background image in the <td> and cover it with the <img>. Then, when hovering over the image, set it to 'display:none'

    Comment

    Working...