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 trialJong Kim
6,145 PointsWhy don't we just use <body> tag for wrapper rather than <div> tag?
Why don't we just use <body> tag for wrapper rather than <div> tag?
1 Answer
Sir Tesla
201 PointsYou can use the body tag but remember that body tags is the parent of all elements inside of the body tag that includes your header, main section, and footer. The div tag is use a generic container hence it has no semantic meaning so it is great to serve as a container. To answer it simply using the div element allows you to only place the elements you want inside of that container.
Plus if you if you want your container to be a different color or even add a background image you can while your body element tag can be another shade of color.
guram dgebuadze
Front End Web Development Techdegree Student 4,122 Pointsguram dgebuadze
Front End Web Development Techdegree Student 4,122 PointsThe HTML <body> Element represents the content of an HTML document. There can be only one <body> element in a document.