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

Casiey Lebron
Casiey Lebron
3,187 Points

When I played around with the Margins and borders I was only able to see a shift in my content- Is that normal?

Originally all of my text was centered in my page. playing around with the margins and borders my content was shifted left - Are margins and borders just typically used for page alignment purposes?

3 Answers

Typically margin's are used to give spacing between elements (Like two buttons that are too close to each other), padding is used to give spacing to elements inside of elements (Like text inside of a content box), and borders are used to give elements an outline.

To answer your question more specifically, margins, padding, floats, transforms, and display are typically used for page layout.

Borders not so much.

It is good to play around with margins/borders and padding so that you can be able to see what effect these have on your content and then you decide what is best for yourself.