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 trialSahar Nasiri
7,454 PointsPadding and margin
I don't get exactly what should I do with these two elements! For nav I don't see any changes after set padding and margin! Can someone explain these two elements for me, please?
3 Answers
Ethan Moffat
3,223 PointsHey Sarah, I am here to explain Padding and Margin to you. Margin is used for clearing around the element (outside the border) when padding is used to clear around the content (inside the border). For example, lets say I had a class names stats, I can select that by doing .stats. Now lets say I wanted a border around the class. But it is way too close together, so I will use padding. Essentially padding will make room inside the class or id you are selecting. Now margin will make space outside the element or class. For example I wanted News and announcements now so close to my navagation area so I would put margin-bottom: 50px or margin: 0px 0px 50px 0px;
If you need help with your navagator do not hesitate to send your code down in a Markdown Cheatsheet. And me or someone from the community will be glad to help you out :). Make sure you are including your stylesheet aswell. You can also try checking if all your documents are saved.
Sahar Nasiri
7,454 PointsYour answer was very helpful, tanx ;)
Ethan Moffat
3,223 PointsYour welcome :). Did your issue get resolved though?
Sahar Nasiri
7,454 PointsTotally :) but here's a question, what is Markdown Cheatsheet? :D
Ethan Moffat
3,223 PointsA markdown Cheatsheet is for syntax examples in answers and responses. If you were really stuck and nobody can see your code Markdown Cheatsheet is for other students to see and resolve what you are having issues with :). It can also be used to Bold your text and other features awell. Click Markdown Cheatsheet above Post Answer.
Matthias NΓΆrr
8,614 PointsMatthias NΓΆrr
8,614 PointsYou can use this box-modell as a reference point.
https://wiki.selfhtml.org/images/7/7a/Boxmodell-detail.png