home fanart gallery downloads tutorials www

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; This can be a very simple and straight forward procedure.

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:

So I've requested the div layer, labelled it my textbox, positioned it and given it an overflow instruction so scrollbars will appear if needed. Lastly you need to remove any </body> and/or </HTML> tags from this page as we will conclude in the footer now.

This is the end of your header.php

Now for the easy footer.

All you need in this is to close the div layer, and close the main page. So very simply my coding would look like this:


And now for the part you need to action on each page. But just think once you've done this you will never have to make any changes to individual pages again!

So at the top of each page you need to add:


And at the bottom of each page:


This is telling the page that it needs to open the header and the footer and to be displayed where you placed your textbox div layer.

It's really as simple as that. The only last thing you need to remember is your links as they won't need to open pages in frames anymore! Just the default page is fine!