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 trialWilliam Meyer
Courses Plus Student 3,423 PointsGrid.css
In Nick's video "working with grids" the margins are set:
0px, 20px, 10px, 0px --that is top, right, bottom, and left, respectively.
I do not understand why there is no left margin. I do not understand why there is a bottom margin.
Is there a reason for this? Or are these just preferences?
Thanks in advance for the tips!
1 Answer
Nick Pettit
Treehouse TeacherHi William Meyer,
As Brian Story said, adding margin on both sides will duplicate the margins on both sides of the elements and then cause some undesirable stacking. Try adding margin on both sides and you'll see what I mean! :)
Muhammad Abdussamad
243 PointsHi Mr Nick Pettit where i can get both CSS files normalize and grid.css can you give me link plz so i can add in my project
Nick Pettit
Treehouse TeacherSure! You can download the code from any of our videos, and the files will be contained there.
For your convenience, here's a direct download link to the completed project: http://treehouse-code-samples.s3.amazonaws.com/websitewaters-island01-stage04-code.zip
Brian Story
Courses Plus Student 2,148 PointsHey Muhammad http://necolas.github.io/normalize.css/
and the grid.css tutorial is found here http://teamtreehouse.com/library/websites/build-a-simple-website/creating-a-website-structure/adding-grid-css
Muhammad Abdussamad
243 PointsThankssssssss
Brian Story
Courses Plus Student 2,148 PointsBrian Story
Courses Plus Student 2,148 PointsIf you add a left and top margin it will double the margin between elements when they stack.
If you want to see what I'm talking about visually create a inline list of elements, add background color in css and add margin to both the left and right. You will see that the left and right margins are smaller than the margins between the boxes.
If you don't understand how to do that let me know and I'll code it up real quick for ya to demonstrate.