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!
HTML :
CSS :
JS Fiddle : http://jsfiddle.net/AJNnZ/26/
Another way that's kind of hackish is this (using jQuery):
Then you style your
div
any way you like.simple and easy way to make an INPUT tag as an image
Use an image submit button, as the doc says:
(I would not use an image suggesting snailmail when setting up an online form, but maybe there is some reason to create such associations.)
You can override the style given by the browser to the button.
For example adding this to your css does the trick for me (on Chrome):
But really if you are not going to use the browser's css for the button, you should probably not use
<input type='submit'>
at all, and just insert the image (via an<img src="" />
tag or a<div>
with the image as background) and attach a click listener to it.For example:
The html:
The javascript (assuming you use jQuery):