Align a button? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Align a button?

For my code, I need the button to be aligned to the center, but I can't change its position. Does anyone know how to center the button?

6th Jun 2020, 6:30 PM
Nicole
9 Answers
+ 4
You can do it by css too. Text-align: center;
6th Jun 2020, 6:42 PM
Samira
Samira - avatar
+ 2
Of course. Could you link your code please?
6th Jun 2020, 6:37 PM
JaScript
JaScript - avatar
+ 2
<center><button></button></center>
8th Jun 2020, 12:26 PM
KUSHAL AGARWAL
KUSHAL AGARWAL - avatar
6th Jun 2020, 6:41 PM
Nicole
+ 1
Ja Play It's okay, thanks for your concern!
6th Jun 2020, 6:43 PM
Nicole
0
Change display:block Set :width Margin:auto Try this
7th Jun 2020, 8:47 AM
Shivam Rawal
0
<center><button>button</button></center>
26th Apr 2022, 10:22 PM
🅰️🅱️
🅰️🅱️ - avatar
- 1
<div> <input type="button" value="press"> </div>
8th Jun 2020, 5:45 PM
Rushikesh Kate
Rushikesh Kate - avatar
- 2
You can do it by ccs and java also
7th Jun 2020, 6:38 PM
《A$# ☆ $ING#》
《A$# ☆ $ING#》 - avatar