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

HTML How to Make a Website Styling Web Pages and Navigation Build Navigation with Unordered Lists

Tony Petroski
Tony Petroski
1,789 Points

Sequence of Padding & Margin Property values

Hi

Can anybody verify my comprehension below?

Working clockwise, Top (0), Right (5), Bottom(30), Left(0) margin: 0 5px 30px 0; padding: 0 5px 30px 0;

/* two values, first is top & bottom(5), second is right & left(0) */
margin: 5px 0;
padding: 5px 0;

/* one value, Zero for all four sides  */
margin: 0;
padding: 0;

thanks,

Tony.

1 Answer

Erik S.
Erik S.
9,789 Points

Hi Tony, That is correct! To complete your thoughts, if you specify three values, than the order will be: top, left/right, bottom. Happy Coding