div layers tutorial
This tutorial is for anyone who has been using frames of any kind and wants to move to div layers and php.
There are many advantages to this move, some of the big ones being;
- Pages have their own url so can be bookmarked
- You will never have visitors viewing a large image inside a small frame space, or trying to get a link to another site and bring that up in the frame
- Google and other search engines are more likely to find words searched if they are on pages as opposed to frames.
First open your main page. The one you have your graphic/banner on and your position of the frames. You need to rename this to 'header.php'. Take off all the frames so you are left with your background only. If you have a navigation also in the form of a frame you can create a div layer for this by coding the following:
You can see from above that the div layer is opened and positioned much like a frame, the content is then coded and the div layer is ended as you would end
any codes.
Now let's take what would be your main frame where the content would open up for each page. This you only need to open the div layer for. Literally you have
to think of this as a sandwich. The header.php is the top slice of bread. Your content pages are the filling and the last page you will create to end the
sandwich will be the footer.php
So to open your div layer for the main content you literally code like this:






