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 How to Make a Website Adding Pages to a Website Style New Pages

Michael L
Michael L
2,482 Points

.Profile-photo margin property values meaning not clear

Hello - the question is about margin property for profile-photo class that was attached to the image.

Here is the rule:

.profile-photo { margin: 0 auto 30px }

What is the meaning of margin values when there 3 of them? (I understand that if we have 4 values, it applies "clockwise": top, right, bottom, left; if there are 2 values, the first one is for top and bottom and 2nd one is for right and left.)

Thank you in advance!

1 Answer

rydavim
rydavim
18,814 Points

When you only specify three values, they are taken as top, right and left, bottom.

You can find the w3schools page for the shorthand here.

I personally don't find the three value shorthand intuitive, so I avoid using it. Maybe with more experience I'll find it easier to remember. I suppose if you think of the full shorthand as clockwise, the three notation is top-down.

Michael L
Michael L
2,482 Points

Thanks a lot, appreciate the quick response!