Menu Example

Several people have written me about the menu system I use on this site and how to customize it for their own. This page is a bare-bones example to help you understand how it is structured. I only use three levels but you can add more.

This menu system is not my original work. I adapted the menu system I found at the Tanfa design site.

Of all the CSS drop-down menu systems I've seen I have found that this one seems the best.

This page uses the following files. The CSS files are linked to in the header of the page. The menu and footer are added using the PHP "include" function.

Because the menu content is in a separate file that is "included" using PHP, I can change that one file and every page on my site automatically has the same updated menu. For instance, I added a link to this page in the menu.txt file. Now every page you go to on my site has that updated menu. The same is true of the footer on every page.

Likewise, using external style sheets means that when I change those files every page on the site is similarly updated. For example, if I want to change the page background I don't have to change every page, I just change the one default.css file.


IE6 - IE6 does require javascript for the menu to work. It uses a csshover.htc file in conjunction with IE conditional comments. You can see the conditional comments by viewing the source for this page. Here's the link to the file I use.

Here's a link to the Tanfa page.


NOTE - If you're going to customize these files for use on your own site, take heed of the following: