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 Simple PHP Application Creating the Menu and Footer Including the Footer and Adding Additional Pages

Ryan Hellerud
Ryan Hellerud
3,635 Points

Why does he include the top closing div in the footer file?

Just seems a little confusing as to why he is copying an extra </div> at the top and I think he did something similar in the last video, too. Can someone explain this please?

3 Answers

Mark Phillips
Mark Phillips
13,124 Points

Hi Ryan,

This same question was asked about a year ago. I was wondering myself so I Googled it and came across this forum topic that goes into a bit of detail as to why these opening and closing div tags were included in both the header and footer files.

Hope this helps!

Mark

Hi Ryan,

It is a little confusing. If you look at the page source after the page loads you'll see it looks like normal html (Right click on the page and select view source). This is often done when many pages in a web site have the same header and footer. If changes are desired then it only has to be done in one place. Personally, I don't typically don't split the divs like that.

Right now I'm working on a site were no page has static html, it's all generated by function calls.

Jeff