CSS Image Links
I’ve used CSS to turn a list into a navigation bar and really like how clean and simple the resulting html code is. When there is only one link, for say a button, I use the following code to get an image link with a hover effect:
CODE:
- <a href=”more.php” id=”btn-more” ><b>learn more</b></a>
-
- #btn-more {
- background: url(”../_images/btn-more.gif”) no-repeat;
- width:75px; /* the width of your button image */
- height:21px; /* half the height of your image */
- display:block;
- text-decoration:none;
- }
- a:hover#btn-more {
- background-position: 0 -21px;
- }
- #btn-more b {
- display:none;
- }
For the image I made a GIF with both the normal and over button states
and here is the final link: learn more
