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 Getting to Know Bootstrap Creating a Simple Page

Sincere Villanueva
Sincere Villanueva
5,992 Points

Horizontal centering with "mx-auto"

Per the documentation, "mx-auto" can only be used on content that has "display: block" and a "width" set. I do not see where either of these properties were defined in the code.

Could someone please explain where these properties were defined?

Thanks so much!

Mike Schaming
Mike Schaming
13,925 Points

Hi- I'm assuming the display and width are included in the class used for the input- accessed from the Bootstrap CDN. But I may be wrong- it's a little different for me not using a CSS file.

1 Answer

Note that many HTML elements have a display value of block set by default (or rather, by the user agent/browser), and would then effectively have a width of 100%.