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 trialBrett Burley
2,922 PointsMargin 2.5% on top and bottom as well?
I was wondering if the margin with a single value of 2.5% will give each list item a 2.5% margin around the whole thing or just on the left and right.
1 Answer
Kevin Korte
28,149 PointsIt would give the margin all the way around, but in a grid system, you'd end up with 5% margin left and right, but still only 2.5% margin top and bottom because of collapsing vertical margins.
Brett Burley
2,922 PointsBrett Burley
2,922 PointsIn a grid system? Is the html layout always in a grid system? or does it become a grid system because we are stacking the pictures horizontally and vertically with float: left; and max-width: 45%.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsI use the term grid loosely. By grid, I mean you are using some sort of layout to position elements on the screen. That's your "grid".
So by having multiple elements on a page, with sizing and position, you have thus created your own grid. When you have elements positioned around each other, the vertical margins are going to collapse when two elements are stacked on top of each other.
Hopefully that helped clarify.
Wilztan Andrew
Python Web Development Techdegree Student 4,979 PointsWilztan Andrew
Python Web Development Techdegree Student 4,979 Pointsso it mean in that coding, the 2.5 % still give to the top and bottom?