Custom Image for Reset button, without Javascript

How-To, CSS, Design — Ebrahim @ 2:24 am

Several solutions for applying a custom image to a ‘RESET’ button already exist, but there is better (and easier) way to do it I believe, without Javascript and only a few lines of CSS.

UPDATE: “text-indent” doesn’t seem to work in IE. Check the updated code below.

Button Image:
Reset Button Dimensions: 62 x 22 pixels

HTML Markup:

1
<input class="reset_button" type="reset" value="" />

CSS:

1
2
3
4
5
.reset_button {background:url(../img/reset_button.gif) no-repeat; /* Define Image Path */border:0;width:62px; /* Define Image Width */
 
height:22px; /* Define Image Height */
 
}

Now, lets see it in action:

Hope it helps!

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2008 EzzyEnough