The Current State of HTML5 Forms

height, width, alt and src

<input type="image" src="images/smurfberries.gif" 
   height="100" width="100" 
   alt="click me">

Live Demo

Firefox
Safari
Safari Mobile
Chrome
Opera
IE
Android
Supported Supported Supported Supported Supported Supported Supported

The Low Down

Similar to the <img> element, the height, width, src, and alt attributes define the height, width, source and alterative text of the image button.

  • The height and width attributes are only relevant on <img> and image buttons, <input type="image">, defining the size of the image:
    • The height attribute defines the height of theimage in CSS pixels. The width attribute defines the width.
    • If omitted, and not defined with CSS, the height and width of the image will be the actual size of the image.
  • The src attribute defines the source or location of the image.
  • The required alt attribute provides alternative text in case your image doesn't show up and for users who can't otherwise "see" your image.