Pavlos1316 Posted June 16, 2011 Share Posted June 16, 2011 Is there a way to make an img button to act/behave like type="submit" at the appearance part? I mean when you click it to see that you are clicking a button and not a static image. Thank you Link to comment https://forums.phpfreaks.com/topic/239510-imgg-buttons/ Share on other sites More sharing options...
Drummin Posted June 16, 2011 Share Posted June 16, 2011 I would think you could add a css class to the input field. Note that styling buttons might look different in different browsers. Css might look something like this. .button { text-align:center; font-size:12px; width:90px; height:20px; padding:0; margin:0; background:#fff url('images/Button.gif') no-repeat; color:#000; } .babybutton:hover { text-align:center; font-size:12px; width:90px; height:20px; padding:0; margin:0; background:#fff url('images/Buttonhover.gif') no-repeat; color:#87CEFA; cursor: hand; } Link to comment https://forums.phpfreaks.com/topic/239510-imgg-buttons/#findComment-1230360 Share on other sites More sharing options...
dragon_sa Posted June 16, 2011 Share Posted June 16, 2011 you can also just set a form input like this, when clicked by default it will submit your form <input type="image" name="mybutton" src="image.jpg" width="55" height="22"> the width and height tags are set the same size as the image you want to use for the button Link to comment https://forums.phpfreaks.com/topic/239510-imgg-buttons/#findComment-1230372 Share on other sites More sharing options...
Pavlos1316 Posted June 16, 2011 Author Share Posted June 16, 2011 Hello, dragon_sa, I already submit my form successfully. I just want to make my image to appear like clicking a button when it's clicked and not be just a static image. Right now I am testing the button tag with some css styling: <button class="bttnlike"><img src="" /></button> //css .bttnlike{ background-color: transparent; border: none; } and I think is working... will see. Link to comment https://forums.phpfreaks.com/topic/239510-imgg-buttons/#findComment-1230421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.