3

i want to use an image as reset button what code i should use in HTML and CSS ?

Matt Ellen
  • 11,268
  • 4
  • 68
  • 90
Muhammad Hussain
  • 141
  • 2
  • 2
  • 11

2 Answers2

7

Think this should do the trick.

 <button type="reset">
    <img src="#" alt="" />
 </button>
Hux
  • 3,102
  • 1
  • 26
  • 33
  • It shouldn't change the shape of the image unless you specified a width/height on the image/button? – Hux Jan 03 '10 at 10:42
4

Good question. Can't be done AFAIK. Images can only serve as submit buttons. You would have to use Javascript to do a onclick="this.form.reset()" on a normal image, or style a normal reset button using a background image (should be possible without problems).

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • Check out MiGs approach, it works without JS and you just have to style the button. The Javascript I quote above you would just put into the image tag ` – Pekka Jan 03 '10 at 10:45