I have this plain submit button appearance in my html code
<input type="submit" name="pay now" value="pay" />
I wish to make the submit button look like this
<a href="#"><img src="images/shopping-cart/check-out-btn.png" border="0" /></a>
but should stick with its submit type
how to do that ?
-
useful link : tyssendesign.com.au/articles/css/styling-form-buttonsxkeshav– xkeshav2012年01月11日 06:08:24 +00:00Commented Jan 11, 2012 at 6:08
-
solved this problem by <input type="image" src="blah blah blah">sasori– sasori2012年01月12日 13:39:27 +00:00Commented Jan 12, 2012 at 13:39
3 Answers 3
You should use CSS for that:
input[type="submit"] {
background: url(images/shopping-cart/check-out-btn.png);
width: 200px; /* width of image */
height: 50px; /* height of image */
border: 0;
}
You should probably use a more specific selector though.
3 Comments
A nice way to do this is using the button element.
<button type="submit"><img src="images/shopping-cart/check-out-btn.png" border="0" /></button>
It works just like a regular input with type=submit, but you have much more freedom.
Comments
You can make an image into a submit button by setting the type attribute of the input element to image:
<input type="image" src="/path/to/image.png">
For more information, read the image Button State section of the HTML specification.