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 trialnicolaspeterson
8,569 PointsI'm confused by all the different container divs.
Looking at Guil's HTML, I'm a bit put off by all the different divs used in his layout. I understand these are just generic containers, but I'm confused as to how they interact with one another, if that makes sense. In the previous stage, his use of selectors completely lost me, and that was down to the containers being set by all the different div elements.
1 Answer
Jonathan Grieve
Treehouse Moderator 91,253 PointsDiv elements don't really "interact" with each other other than they share a parent/child relationship just as any other element does in HTML.
You can use a div element to wrap multuple div elements inside it. Like this.
<div>
<div></div>
<div></div>
<div></div>
</div>
So now you have 1 element that is a parent for 3 other div elements.
Now you could select them with CSS by using a class for the container and an id element for each of the 3 child elements.
<div class="container">
<div id ="one"></div>
<div id="two"></div>
<div id="three"></div>
</div>
Does this help? If not, post your code and hopefully we can help out. :)
nicolaspeterson
8,569 Pointsnicolaspeterson
8,569 PointsThis makes a little more sense, thanks. Just the organization of the practice workspace was a little confusing to me.