+ 5
How do I align a button to the center of the page
I’m trying to work on a project and I can’t figure out how to align the button to the center of the page.
10 odpowiedzi
+ 7
Add to the container this css style:
.container {
text-align: center;
}
+ 5
If you want to be anything in the center exist <center> tag
+ 3
Alex, <center> does not have closure.
+ 2
+ 1
https://code.sololearn.com/W51CLpHyrWy0/?ref=app
+ 1
button{ display: block; margin: 0 auto;}
+ 1
.selector{
text-align: center;
}
0
You can go into the html tab and write with in the button element. Example: <button align = "center"></button>.
You can go into the css tab and do the following:
button {
position:fixed;
top:40%;
right:30%;
}
depending on the size of the button you may need to re position the top and right numbers,
0
to align a button simply in html you can put <center><button></button></center>
0
button {
text-align: center;
}