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 trialSERGIO RODRIGUEZ
17,532 Pointsgrid-container class in header element
In Stage 5 of the CSS Layout course Guil inserts a new "div" inside the "header" element to set it as a grid-container class. Why can't we just use the "header" for that purpose?
2 Answers
tobart
13,518 PointsWe want to span the header the full browser width. At the end of the chapter we define a maximum width for our grid-container, thus makes it span just that amount of pixels. Inserting the new div ensures that only the content within will be set to the max-width, while the header spans the full width of the browser window.
Bianca Negron
9,486 PointsCould be because the header element should fill 100% of the screens width, whereas the grid-container will always have a smaller set width for different screen sizes.
Joshua Holland
2,865 PointsJoshua Holland
2,865 Points"Why can't we just use the ____ for that purpose?" If you posted code in there, it removed it.