PDA

View Full Version : Standard CSS Menus, how to do it?



stoob
06 Jan 2007, 05:57 AM
I want to to have a standard CSS menu that sits either horizontally on the side or along the top, nothing fancy but I just want to put the code in my pages so that the menu updates on all pages when i update the raw code.

Does anyone know how to achieve this or are there any tutorials out there?

I'm sure this is an easy question and standard practice.

StooB

pilotdesigns
06 Jan 2007, 11:10 AM
If you want some super basic CSS menus and layout help, feel free to look at the code on some of my pages. I'm still some what of a CSS novice, so it's not complicated.

www.pizazzboutique.com
www.madisonrentalsinc.com
www.isispi.com
www.bridalandformalcenter.com
www.peanutbutterkissesboutique.com

And one thing you will NOT see in the code is the php include. That is what you will want to have the separate file for the menu so you only update in one spot. That is php not CSS.

Basically, all you do is take the section that has the menu in it and put it in a separate file called menu.php. It will NOT have the <html><head>&<body> tags.. it will JUST be the code for the menu. In your ACTUAL page, you will replace the menu with:
<?php include('menu.php'); ?>
And save that page as whatever.php
You can also do this for the header and footer. It helps a TON... you just have to make sure your host supports php, usually if it doesnt you can switch over for free, but most good ones do now a days.

For the CSS part of the menu, you just use it like an unordered list, and use CSS to make rollover effects.
All of my layouts are called layout.css, so you can go to the sites above then /layout.css and see the code for that.

Good luck, let us know how it goes.