How can I add a picture in a button type? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 17

How can I add a picture in a button type?

so while making a button, how can I add some kinds of logo/pic along with text in that box? a coding example will be helpful 😃

9th Dec 2017, 7:00 AM
inactive instagrammer
inactive instagrammer - avatar
8 Answers
19th Dec 2017, 5:05 AM
Sreelakshmy
Sreelakshmy  - avatar
+ 4
<input type="button" id="name"> in css: #name{ background-image:url("image location"); }; image size and button size should be equivalent to view the image on website
9th Dec 2017, 7:09 AM
Joel Roy
Joel Roy - avatar
+ 3
<button><img src="">Hello</button> to insert image or if u r using any icon library like fontawesome then <button><i class="fa fa-home></i>Home</button>
9th Dec 2017, 7:05 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 2
like an icon next to the text?
9th Dec 2017, 7:02 AM
Nope
Nope - avatar
+ 1
Using following code we can easily embedded the logo/pic in any type of button: <button type="button" style="background: url(<img address>)">Click Me!</button>
10th Dec 2017, 7:09 AM
Harshita Jain
Harshita Jain - avatar
+ 1
<a href="url"><img src=""></a>
10th Dec 2017, 4:16 PM
ℬℯℳℬℐ
ℬℯℳℬℐ - avatar
10th Dec 2017, 2:14 PM
#RahulVerma
#RahulVerma - avatar