Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

William Jingga
William Jingga
4,604 Points

Centering the register button within the form

I am totally new to Bootstrap. What class property should I use to center the register button within the form?

Henry .
Henry .
52 Points

Not sure if I am understanding it correctly but you can put the button in its own DIV and text-align center it ?

https://codepen.io/anon/pen/gvVmMx

1 Answer

Thomas Chappel
Thomas Chappel
6,342 Points

I am not sure of my answer, because i would need to see the structure of your code.

Maybe your form is inside a Bootstrap row or column, so the most flexible solution is that, preserving the layout of your code, you just add, after the set of form fields, a div with with the following class values:

'''html <div class="d-flex justify-content-center">...</div> '''

Then inside the div you place your submit button:

'''html <div class="d-flex justify-content-center">. <button type="submit" >Register</button> </div> '''

Cheers