Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Listing and Sorting Inventory Items Creating the Catalog Array

wrapper div

Why did they give the class of wrapper to the div?

Isn't there already a div with the class of wrapper in the header.php include?

I know you can have multiple instances of classes, but isn't the wrapper for the whole page and if so, wouldn't you now have 2 wrappers on the page?

2 Answers

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,705 Points

It's been a while since I've taken the course but my assumption is this is to provide a wrapper for content rather than the interface itself.

Actually looking at the course name again I've not yet taken this course but again there must be a consideration of CSS media query breakpoints going on here. Have a place and see if there's any negative effects to the web site you're building of not having the second wrapper div. :-)

I got confused - the 1st wrapper was for the nav and had opening and closing tags on the header include.

I thought the 1st wrapper div was for the whole finished page (like a main tag) and the closing div tag was on a separate include/file!

Thanks for the help, the tip about trying it really helped.