#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    1
    Rep Power
    0

    Question CSS: Change background-image on link mouseover


    Hi.

    I have just recently begun working with CSS. Is it possible with CSS (and without the use of any JavaScript) to have the background image change on a link mouseover?

    I have the first image below (blue.jpg) set as my default background image and would like the second image (blue1.jpg) to display when the user hovers over a particular link.

    http://krypton.mnsu.edu/~hoffhe/blue.jpg
    http://krypton.mnsu.edu/~hoffhe/blue1.jpg

    Thanks for any help anyone can offer
    Last edited by acersaccharum; March 21st, 2004 at 01:03 AM.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    10
    Rep Power
    0
    a:link {
    background-image: url(a.jpg);
    }
    a:visited {
    background-image: url(a.jpg);
    }
    a:hover {
    background-image: url(b.jpg);
    }
    You can change other attributes too.

    Make sure a:hover goes after a:visited or you will see
    problems in Netscape.

IMN logo majestic logo threadwatch logo seochat tools logo