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 Add Iconography

Frederik Delfosse
Frederik Delfosse
1,874 Points

why add padding and margin to .contact-info

Could you explain to me why you are adding padding and margin to this class?

4 Answers

Hi Frederik, Because we want the unordered list with the class .contact-info to be aligned with the h3 element above it, we gave it a margin and padding of 0. This, of course, makes the margin-left and the padding-left 0, ensuring that it is completely aligned on the left with with the h3 element above it. The h3 element also has a margin-left and padding-left of 0, so both elements are leaning snug with the left side of their container element.

Justin Hunter
PLUS
Justin Hunter
Courses Plus Student 11,484 Points

I'm not sure if this answes your question, but if I remember the video, that class will contain all of the pertinent contact info. You want to give it space between other elements, so adding padding and margin will do that.

It's important to use padding and margins and they give other elements space and make things easier to read a good example is like these comments posts imagine if they were all crammed together you wouldn't want to read it but white space makes text clear and easy to read hope this answers your question if so mark it as the best answer

Frederik Delfosse
Frederik Delfosse
1,874 Points

Yes, I do understand but they've added a padding and margin of 0 overthere. And that's why I am getting confused...