In article <11*********************@g47g2000cwa.googlegroups. com>,
Xah Lee <xa*@xahlee.org> wrote:
Just created Tab Menu tutorial.
Two tutorials for Tab Menu.
JavaScript implementation:
http://xahlee.org/js/tabs/a.html
I avoid javascript whenever possible. Tabs are much simpler in CSS.
Pure CSS implementation:
http://xahlee.org/js/tabs2/a.html
This is an example of how NOT to do it, in my opinion.
You don't need to express tabs as a list. This is especially
important for tabs, which you may want to look like a horizontal
list of links for non-css browsers, rather than a vertical list of
links.
All you need is a border and color definition for the 'A' tag. Then
your tabs are as simple as a series of links:
<div id="nav">
<a name="#" id="current">current active tab</a>
<a href="page1.html">page 1 tab</a>
<a href="page2.html">page 2 tab</a>
</div>
See? No <ul...> list required.
The following CSS definitions for the HTML above will result in a nice
series of tabs, with the current tab having no bottom border to look
continuous with the page:
#nav { /* navigation bar which will have the tabs */
font-size: 1em;
text-decoration: none;
clear: both;
padding-top: 1px;
padding-left: 4px;
border-bottom: 1px solid #000000;
white-space: nowrap;
}
#nav a, #nav a:hover, #nav a#current { /* basic tab properties */
font-size: 1em;
text-decoration: none;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
padding-left: .2em; padding-right: .2em;
padding-bottom: 0px;
}
#nav a { /* normal color of tab is CCCCCC */
border-bottom: 1px solid black;
color: #000000;
background-color: #CCCCCC;
}
#nav a:hover {
border-bottom: 1px solid black;
color: #000000;
background-color: #CCFFFF;
}
#nav a#current { /* color of "current" tab is white with green text */
border-bottom: 1px solid white;
color: #009933;
background-color: white;
}
-A