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
Claudio Gomes
8,872 PointsWhy do I need to set right margin zero on a navbar in Bootstrap
I cannot understand why there's a need to apply a margin zero (m-r-0) on the navbar element @ https://teamtreehouse.com/community/video:61142 (5:26 min)
If I need to apply a margin right, why dont I also need to do the same for the left margin on this element?
1 Answer
Stuart Elmore
84 PointsThe class that removes the margin-right is just for aesthetics purpose. That element by default has a margin on the right and left, meaning that when it is floated to the right it will appear indented from the right hand side. Removing the margin prevents this. Similarly if you were floating it left then you would want to remove the margin left.
Yes, you could remove the left margin in this instance, but that just means that when you make the viewport smaller as he does at 5:30 it would not snap until the "Presented by Treehouse" touches the last 'e' of "Schedule", as apposed to a few pixels before, as shown in the video.
Does that help? :)
Claudio Gomes
8,872 PointsClaudio Gomes
8,872 Pointsexplained. thanks.