A blog & community for non-professional web designers, programmers, webmasters, and other web savvies.

CSS Image Button Rollover

March 19, 2009 - 12:00am -- Haily

By including both your button image and its rollover image in one image such as this, you can create an effective rollover script with only CSS. Explore this technique and create something stunning!

<style type="text/css">
/*****************
--CSS Image Button Rollover
--More CSS Scripts at
--http://icecaves.net/tags/css
*****************/
#button1 {width:120px;height:45px;overflow:hidden;display:block;background:url('http://icecaves.net/files/nav2.gif') top left no-repeat}
#button1:hover {background-position:bottom left}
</style>
<a href="http://www.icecaves.net" id="button1"></a>
Code Preview: 
Tags: 

Comments

theannabella
theannabella's picture
Snowball (?)
Rank Points: 8 (?)
Posts: 86
Status: Offline
WWW

This should definitely come in handy. I'll try to incorporate it into my next layout. :)

Anna
Anna's picture
Icicle (?)
Elite Yeti (?)
Rank Points: 48 (?)
Age: 17
Posts: 827
Status: Online
WWW

Yeah, I've used this in past layouts. :)

--------------------

Yay, Anna!
AnnaNeo

aashni
aashni's picture
Iceberg (?)
Elite Yeti (?)
Rank Points: 73 (?)
Age: 19
Posts: 1,753
Status: Offline
WWW

If I remember correctly, this is what I used for this layout: http://i826.photobucket.com/albums/zz190/enchantmenot/sitely/pastLayouts...

--------------------

My Sites: 1 | 2 | 3 | 4 | 5 | 6

Louise
Louise's picture
Snowball (?)
Rank Points: 6 (?)
Posts: 223
Status: Offline
WWW

I used it for one of Moonwalked's old layouts too, back in the day...

--------------------

"Baldrick, have you no idea what 'irony' is?" "Yes, it's like 'goldy' and 'bronzy' only it's made out of iron."

@IceCaves on Twitter

    Stay Connected

    Twitter Facebook Tumblr Google+ Glaciallis Google RSS

    *Follow us on Twitter or Facebook to also follow minor site updates that don't make it to the homepage news.