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 4 Basics (Retired) Using Bootstrap Components Adding Buttons and Button Groups

"center-block" no longer exists—use "d-block m-x-auto".

"centre-block" has been removed from the latest bootstrap 4 alpha. From my reading of the bootstrap utilities documentation, you now need to use a combination of "d-block" (to make the button a block-level element), and "m-x-auto" to set left and right margins to auto, to recreate the "center-block" class.

7 Answers

Lewis Marshall
Lewis Marshall
22,673 Points

Thanks I was looking for this!

Hi thanks so much for the above info, but mx-auto is still not working in my code. did something change again?

Why can't you just text-sm-center it or pull-sm-right-offset What's the different? Very Confused!!

are you talking about centering the button?

Paula Mourad
Paula Mourad
5,154 Points

Use mx-auto. Not m-x-auto.