<!-- The Pagan WebCrafters’ Association -->

“Serving the Magickal, Occult and Pagan Earth Community.”

Horizontal css Menu with Tab High-lite

by Parker Torrence

This tutorial will help you to quickly create a Horizontal css Menu from an unordered list (ul) with the use of a combinations of borders, padding and a:hover to achieve different list effects. In addition you will be shown how to take it a step farther and create a Current page Tab High-lite, by adding a css ID in the Body tag, and a css Class in the List tags.

Before you start, you will want to open a text/html editor so you can cut and paste the code and another browser window if you wish to follow along on Accessify.com.

Part I

First go to Accessify.com and use the list-o-matic. For this example I selecting five links with titles, I click next.

After I've entered "Link Text," "Link Title," and a # for the urls, I click next.

On the "List-o-Matic" form I'm selecting Style 9 (credit Jeffery Zeldman).

For this example I'm using style 9, you can choose any that you wish, . (The instructions in Part III should work with any of the Styles listed, just adjust the color to what you want.)

Right now my html code from Accessify.com looks like this:

And my css code from Accessify.com looks like:

This is what style 9 from Accessify.com looks like:

What you want to do now is add a class to each of the <li> tags.

Part II

If you use a style other then 9 skip down to Part III.

First, for me the colors are too light, so I am going to change them.

Now I like the look of Style 9 except that the last tab is open at the right. To correct this on the css code we add:

Where #654 is the new color I have selected to use, it should be the same color as the other borders.

Part III

The following steps will make it possible to high-lite the menu tab of the page you are on.

In my example, I have a five page website so on each page in the body tag I would add id="pgone" on page one, id="pgtwo" on page two, etc. until all five pages have an id in thier body tag. Now in your css add the following:

So if this was page 4 of my example website the menu bar would look like this:

If you wish to use the above example, here is the complete Style Sheet:

Code for most of this tutorial is from Accessify.com. See also Keeping Navigation Current With PHP, and Highlighting current page with CSS

Authors' retain all rights to any of their works published on thepwa.net.

Copyright © 1997 - 2004+ by The PWA (Pagan WebCrafters' Association). All Rights Reserved.
The PWA is administrated by Gwen Wolfrose.
Send any comments about this site to

pwa   pwa-l   pwag   pwa lj   xhtml   css  

Articles

Tutorials