Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabs

Status
Not open for further replies.
Most people believe tabs are realy difficult to produce when in fact they can be as easy as a button.

That particular page uses some Javascript, but its not neccessary at all.

As an example:

take 3 pages
Page1.html
Code:
<div id=navtabs><span class="seltab">Page 1</span><span class="tab">Page 2</span><span class="tab">Page3</span></div>
Page2.html
Code:
<div id=navtabs><span class="tab">Page 1</span><span class="seltab">Page 2</span><span class="tab">Page3</span></div>
Page3.html
Code:
<div id=navtabs><span class="tab">Page 1</span><span class="tab">Page 2</span><span class="seltab">Page3</span></div>

The CSS could be:

Code:
#navtabs{
background:...
...
}

.tab{
background:URL("mytabimage.gif");
...
}

.seltab{
background:URL("myselectedtabimage.gif");
...
}


now this is a very simple outline of how to do it. If you wanted to add more complexity, to change the positions if the tabs or whatever, you would need to alter either the nav bar in each page, or use some kind of server-side language to dynamically generate the tabs. But the basic structure is that of several buttons styled liked tabs and then just chnaged the style if it is selected or not.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top