The Box Model

The box model explained the use of margin: auto; that will center the element if the element has a width.

How is margin: auto; different from text-align: center;? Are they interchangeable?

@sinclairetaylor Welcome to the forums. My understanding is that Align-text : center aligns the text within an element. margin: auto centres the actual element. I hope this helps.

1 Like