Grow your CSS skills. Land your dream job.

[Solved] Image Rollovers

  • # December 29, 2009 at 9:41 pm

    Hi Guys

    I do not know whether this can be done with CSS .. but I thought If anyone would know .. it would be you guys at CSS Tricks :)

    On my website I have some image links, and I want them to change when hover and clicked.

    I’m talking about them links to websites in the blue middle strip. I would greatly appreciate any help.

    Thanks Guys.

    # December 29, 2009 at 10:14 pm

    I don’t see why not… You could use CSS sprites to do this. Create an image that includes the normal/hover/clicked states, and then make that a background image on an <a> element (with display:block, and a set height/width). Then, change the background position when the mouse overs (a:hover) and when clicked (a:active).

    # December 29, 2009 at 10:30 pm

    Hi Falken

    I get the first bit about having one image with the states I want .. but then what do I do with that image.

    That is where I’m lost .. what code do I use ?

    Thank You.

    # December 29, 2009 at 10:41 pm

    This has a pretty good explanation:
    http://www.webvamp.co.uk/blog/coding/cs … rollovers/

    # December 30, 2009 at 11:46 am

    Thanks So much Falken

    It worked .. It was a lot of work because each anchor tag was different .. but it worked in the end.

    Thank You So Much :) You’re a star

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".