SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink input.image:hover

    Hello,

    Rightly I can't define CSS or JavaScript need me, so I post in CSS forum. I have this HTML code:
    HTML Code:
    <input type="image" name="submit" src="images/login.gif">
    How I can make, that when hover mouse on this image, image will change to images/login_hover.gif? Thanks.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    This is really a javascript question as you can't change the source of the input image in css although you could change a background image of an input on hover in mozilla but not in ie.

    At the simplest level you could do something like this:

    Code:
    <input onmouseover="this.src='images/login_hover.gif'" onmouseout="this.src='images/login.gif'" type="image" name="submit" src="images/login.gif">
    But it would be neater to do it unobtrusively so I'll move this to the js forum so someone else can answer.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •