How to add image in a button ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

How to add image in a button ?

In the code below I wanna add a image in the 'Apps' button and if possible then please also tell me how to align the 'Apps' button to right . https://code.sololearn.com/WKzkAeBb8uPx/?ref=app

11th Sep 2017, 12:59 PM
Game'OBot
Game'OBot - avatar
6 Answers
+ 17
https://code.sololearn.com/WsOXwpRvfTmQ/?ref=app
11th Sep 2017, 1:37 PM
Ranjan Bagri
Ranjan Bagri - avatar
+ 4
Or if you just wanna trigger stuff, you can add an onclick attribute to an img tag
11th Sep 2017, 1:54 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
I think is better and fast to do an image like a button
11th Sep 2017, 1:33 PM
Daniel
Daniel - avatar
+ 3
You can create a button and add ID or class for the button then go to CSS and use this below. #exampleButton or .exampleButton { background or background-image: url('your image file or link'); }
11th Sep 2017, 1:37 PM
Ferhat Sevim
Ferhat Sevim - avatar
+ 1
use css. background-image for button
11th Sep 2017, 1:41 PM
Milad E
Milad E - avatar
+ 1
Thnx 🤗🤗
26th Nov 2020, 11:53 AM
Dilitha Danujika
Dilitha Danujika - avatar