What are we facing?
I want to achieve a button like effect for some of my links. For instance, it's a matter of positiong the "Download" link more prominent and catchy. I want that link to behave like a button when I hover it. Another option is to have a clickable image with change a little bit when hovering. Of course, I want that effect made entirely in CSS. Is it possible?
The solution
Yes, there is a way, let's based the following example of rollover with images on the Stuart Robertson's post about it.
Choose a image for the regular state of the link (no hovering state):
Just for simplicity, do a silly change to that image to produce a rollover image
Build the link wiht a "span" element with a meaningful description inside. Never forget those image based browsers.
<a href="http://www.aggiorno.com/try.aspx" id="rollover"><span>aggiorno</span></a>
We are almost there. Now the following style for achieving the rollover effect:
a#rollover { background-image:url("Aggiorno-regular.jpg");
height: 110px; width:110px; display:block; }
a#rollover span { display:none; }
a#rollover:hover { background-image:url("Aggiorno-rollover.jpg"); }
This style set background image for the regular state of the link, hides the span content and shows the rollover image when hovering. Our baby now looks like (hover it):
aggiorno
Some external references
[advertisement] Try
Aggiorno for free, the assistant tool for web development you always wanted.