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 CSS Basics (2014) The Box Model Margins

Nick Ars
Nick Ars
5,341 Points

margin and align

I have the following question: when should we use margin or align if we want to move the text (content) to the right, left side or center?)

1 Answer

So margin shouldn't be used to move text. Its should really be text-align

Margin is used to give elements space on the outside of the box model. Padding gives space on the Inside where as text-align is there to allow for aligning text.

Personally I would never use margin for this