How to make button on image | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to make button on image

its easy to make button on image using css and html

23rd Sep 2018, 12:58 PM
Vishwajeet Kakade
Vishwajeet Kakade - avatar
4 Answers
+ 6
To make an image a button: <button><img src = URL_FOR_IMAGE_HERE /></button> OR: <img src = URL_FOR_BUTTON_HERE onclick = DO_SOMETHING /> To put a button over an image: <img src = URL_FOR_BUTTON_HERE width = "50" height = "50"/> <button style = "position: relative; right: 40px;">Click me!</button> To set the background of a button to an image: <button id = "btn">Click me!</button> <style> #btn { width: 50px; height: 50px; background-image: url(URL_FOR_IMAGE_HERE); background-size: 50px 50px; } </style> Hope you find one of them useful!
24th Sep 2018, 6:04 AM
Rowsej
Rowsej - avatar
+ 7
<button type="button"> <img src="submitpic.png" /> </button>
23rd Sep 2018, 2:23 PM
VIkram Kumar
VIkram Kumar - avatar
+ 2
it depends what you are trying to do. It is easy enough to add a button on top of an image and easy enough to make an image the background of a button/make an image itself the button. Keep in mind that buttons and links are different. You can do what the first comment said to make a button out of an image or use absolute positioning and containers to layer a button on top of an image, as well.
23rd Sep 2018, 11:22 PM
Keiome Nikke
Keiome Nikke - avatar
+ 1
<a href=site.com><img src=img.jpg width=1 height=1></img></a>
24th Sep 2018, 8:11 PM
Muhammad Quwais
Muhammad Quwais - avatar