nealec Posted January 27, 2011 Share Posted January 27, 2011 This is the code for a submit button on my site, i have an image called login.png that id like to use instead of the horrible grey submit button, Could someone please rewrite this code for me to use this image. <input type="submit" name="login" id="login" value="Login"> Link to comment https://forums.phpfreaks.com/topic/225899-can-i-use-an-image-instead-of-the-grey-submit-button/ Share on other sites More sharing options...
l4nc3r Posted January 27, 2011 Share Posted January 27, 2011 Loads of answers if ya just google http://www.google.com/search?q=image+submit+button&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a. Basic run down: change the type attribute to image and create an src attribute and set it to the image url. Link to comment https://forums.phpfreaks.com/topic/225899-can-i-use-an-image-instead-of-the-grey-submit-button/#findComment-1166270 Share on other sites More sharing options...
doddsey_65 Posted January 28, 2011 Share Posted January 28, 2011 firstly, dont ask someone to rewrite your code for you. you may annoy some people. instead ask for help or tips. the above post is correct but you can also do it via css. in your css add: input#login { border:0; background:url(your_image_here) no-repeat top left; } Link to comment https://forums.phpfreaks.com/topic/225899-can-i-use-an-image-instead-of-the-grey-submit-button/#findComment-1166449 Share on other sites More sharing options...
©ode® Posted January 29, 2011 Share Posted January 29, 2011 You definitely should use CSS for this. Much cleaner and promotes good code. Link to comment https://forums.phpfreaks.com/topic/225899-can-i-use-an-image-instead-of-the-grey-submit-button/#findComment-1166827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.