Using a tabbed rollover menu in the header of your website can add functionality, as well as making the navigation look good. Doing this in CSS means that you can use it to it’s greatest capacity, easily add or remove tabs and change the colour in different styles.

It is initially important to decide on which tabs you will want to place on your site, and what the colour scheme will be. You need to have an idea of how many tabs there will be, and what the default background and rollover background colour will be. Make a note of these!
The tab area is set as a layer, to hover over a specific part of the page – you set this manually, based on where you would like it to be located.
Simply take the CSS code (see below), and change the commented values to fit in with the colour scheme of your website. You can go deeper and change elements such as the height, width and position of the menu bar if you want.
Download a copy of the CSS code, then link to it as explained below.
Upload the tabsample.css file to your server, then place the following line in your <head> area to link to the stylesheet.
<link rel="stylesheet" type="text/css" href="tabsample.css" />
OK, so you’ve got all the formatting done for tabs in the CSS file, now you just need to place the correct HTML code in your index.php page.
For each tab you want to display, enter:
<ul id="supernav">
<li<?php if ($page=="home") { echo " id="selected""; } else {} ?>>
<a href="/index.php" title="The Weblog">Blog</a>
</li>
-- Repeat as necessary for other tabs --
</ul>
For each different tab, change the following:
"home" – this is a one word description of the page (for the reason why, see below)
"/index.php" – this is the link to that particular page
"The Weblog" – a description of the page you’re linking to
Blog – the word you want to appear in your navigation bar as a link
Note: It doesn’t really matter where you place this source code, as the position they appear in is set in the CSS file. I would recommend somewhere near the header area.
The PHP code in the above line allows you to have an alternative look and feel for the tab on the current page (see the ‘Blog’ tab above?) Simply place this line underneath the
<?php $page="home"; ?>
As before, change "home" section to match that on the tab area.
If you do not want to use this functionality or are not using PHP in your pages, replace the code in Step 5 with the following:
<li><a href="/index.php" title="The Weblog">Blog</a></li>
You should end up with a menu looking similar to the one at the top of this page in no time. It’s a simple method, and spices up your pages navigation!
All excellent! nicely elaborate!!! CaR
Green color is more popular now.. i find it looks like Digg navigation
Good tutorials. thank you
Hi man. I just arrive here from a stumble jump, and I want to add something. First of all, good tutorial and good easy use of php. But what I want to share is that there is a more easy, no server-side solution for that problem, only using CSS. It´s quite easy. You have only to put an "id" attribute to the tabs markup, and to use a "id" in the "body" tag. Smthg like: ... Home Portfolio ... And after that, it´s pretty simple. Just add a css line to change the tab you want when the page you visit is the appropiate. How does it know where it is? Easy, the body "id". So... /*In the CSS */ body#home a#menu_home {/*And put the effects to make it different*/} Same for others sections... Voilá. It´s done.
