Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make my <input type="submit" /> an image?

Tags:

I have a beautiful little CSS image that needs to be a button. I've tried about 20 different methods, none of which work. I just either get a blank nothing or a border with nothing inside.

The html: http://lrroberts0122.github.com/DWS/lab6/level-2/

The image: http://lrroberts0122.github.com/DWS/lab6/level-2/images/button.png

The CSS: http://lrroberts0122.github.com/DWS/lab6/level-2/css/main.css

I can't change it to "submit" for certain reasons, so I need to figure out how to make this work with CSS. Thank you for your help!

like image 390
Lindsay Avatar asked Oct 13 '12 18:10

Lindsay


People also ask

How do you make an image submit in HTML?

The <input type="image"> defines an image as a submit button.

How do you insert an image into CSS?

To add images to a page, we use the <img> inline element. The <img> element is a self-containing, or empty, element, which means that it doesn't wrap any other content and it exists as a single tag. For the <img> element to work, a src attribute and value must be included to specify the source of the image.


1 Answers

Use an image submit button, as the doc says:

<input type="image"> defines an image as a submit button

<input type=image src=button.png alt="Submit feedback"> 

(I would not use an image suggesting snailmail when setting up an online form, but maybe there is some reason to create such associations.)

like image 131
Jukka K. Korpela Avatar answered Oct 20 '22 23:10

Jukka K. Korpela