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

CSS Bootstrap Basics Building Forms With Bootstrap Structured Form Layouts with the Grid

Naoki Yoshida
Naoki Yoshida
6,984 Points

Trying to center the Modal Title and put at the right side the Register button but i can't!

I'm trying with mx-auto, text align center/end, with this code I found on bootstrap:

<div class="d-grid gap-2 d-md-flex justify-content-md-end"> <button class="btn btn-primary me-md-2" type="button">Button</button> <button class="btn btn-primary" type="button">Button</button> </div>

but nothing works! How is the way?? I'd be super grateful.

2 Answers

notrackx
notrackx
2,286 Points

You should set the button to behave as block element first (I got the same problem while centering my button in the form).

<form>
  ...
  <button type="submit" class="btn btn-primary mt-3 d-block mx-auto">Register</button>
</form>