+ 2
Can't run this code
I wanted to make the buttons aligned in the middle. @Sami Khan https://code.sololearn.com/WjGBbdKotGT6/?ref=app
6 Answers
+ 5
Firstly, the class name of your buttons is 'Buttons', not 'buttons' (css is case sensitive).
Second, the 'text-align:center;' isn't necessary (but do not breaking code ;))
Third, as you set the buttons as 'display:block;' your <br> between them introduce space (of one line-heigth)... to fix it, you have to remove them, or just by Css set negative values for top and bottom margin (weird fix: better to remove unnecessary <br> elements ;P)
The working css rules:
.Buttons {
margin:-1.5ex auto;
display: block;
/* text-align: center;*/
}
+ 1
I write it like the following :
.buttons {
margin: auto;
display: block;
text-align: center;
}
0
Add this to your .buttons :
.buttons {
margin: auto;
}
0
Still not working
0
I tried it and it worked. The 2 grey buttons are centered like this:
button
button
0
Exactly, and it works good for me when I run it.