XML technologies / CSS / CSS Cookbook / Forms / Image-based submit buttons

(Excerpt from “CSS Kochbuch” by Christopher Schmitt)

Problem

You want to use an image as a submit button, as shown in the next figure.

Solution

Use an input element whose type attribute has the value image:

<input type="image" name="submit" src="submit.gif" />

The magnifying-glass icon serves as a submit button

Figure: The magnifying-glass icon serves as a submit button.

Discussion

Although adding an image-based submit button is an HTML technique, CSS properties such as border and margin can be used to style the image.

See also

The HTML 4.01 specification for the input element.

  

 

 

 

back to top