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 trial

PHP Build a Simple PHP Application Creating the Menu and Footer Including the Footer and Adding Additional Pages

Why did you copy the HTML into footer.php starting with a closing DIV tag?

In this vid when he took the code from index.php for the footer and put it into footer.php he copied out the HTML starting from the closing DIV of a DIV still within the index.php page.

Why?

Thanks

4 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Tom;

Look in the header.php file. Is there an opening <div> there that isn't closed?

Ken

Yes <div id="content">, so the footer I assume is closing it?

So it seems you are opening the main content DIV in header, closing it in the footer so anything within index.php remaining will always be within the the DIV with the ID Content?

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Tom;

Yup, sounds like you got it. Pretty slick eh? Now when you are editing/debugging the content pages for your site you don't have errant <div> tags floating around and everything winds up being within the Content ID so CSS formatting become much easier.

Ken

oh great thanks for your help.

Ill remember to do this when I convert a website I have been doing for college using HTML/CSS into a PHP driven site.