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 trialDarya Zata
2,562 Pointswhy put div next to body?
Hello all,
i dont really get it well why we should put div at almost same position as body? I would understand if u put div around a block that u cant identify as f.e. as an article. But why is whole body also a div?
thank U
3 Answers
Matthew Long
28,407 PointsYou're right putting the <div>
tag around everything inside the body provides very little benefit. The video was only showing you how a <div>
tag works. It is not normally wrapping the entire content inside the body. You'll typically find them wrapping smaller blocks of HTML like you said.
Kevin Archer
2,619 PointsHi Darya,
I think future lessons go on to illustrate why wrapping everything after <body> in a <div> tag may be helpful when we go on to use CSS with our websites. I'm not quite there yet myself, but I'm almost certain it's mentioned in the lesson!
Darya Zata
2,562 Pointsok thanku
Darya Zata
2,562 Pointsok thanku!
B.B. Groeneveld
2,826 PointsB.B. Groeneveld
2,826 PointsIs that why he mentioned "wrapper div" in stead of just "div"? Just to be sure...
Matthew Long
28,407 PointsMatthew Long
28,407 PointsA
<div>
can be used as a wrapper to wrap elements and style those elements as a group.B.B. Groeneveld
2,826 PointsB.B. Groeneveld
2,826 PointsGreat, thanks.