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 trialBarry Cherry
Front End Web Development Techdegree Student 3,395 Pointswith the div container, why is the div put in as a child element to the <header> if we are going to edit the header?
If we are going to edit the header, shouldn't it have been:
<div class="container">
<header class="main-header">
<h1 class="name"><a href="#">Best City Guide</a></h1>
<ul class="main-nav">
<li><a href="#">ice cream</a></li>
<li><a href="#">donuts</a></li>
<li><a href="#">tea</a></li>
<li><a href="#">coffee</a></li>
</ul>
</header>
</div>
2 Answers
Steven Parker
231,269 PointsThe div
inside provides a convenient target for styling to provide margins and centering for the inner elements, while still allowing the header
itself cover the full width of the window.
Jorge Vega
Front End Web Development Techdegree Student 2,905 PointsThank you Steven!
Barry Cherry
Front End Web Development Techdegree Student 3,395 PointsBarry Cherry
Front End Web Development Techdegree Student 3,395 PointsI didn’t look at it like that, thanks very much pal.