The purpose of this code is to simulate a tab control for a web page.
A set of buttons are drawn on the page to simulate the tabs.
Above or below the tabs, a set of tables are drawn, one for each tab button.
Pressing a tab button changes the colors of the tab buttons and changes which table is displayed (the rest are hidden).
To use this program, copy the three sections of code below into your HTML page.
Copy the first section into the <BODY> of your HTML, in the place where you want your tab control.
Edit that code to make the correct number of tab buttons and to add content for each of the tables.
Copy the second section into the <HEAD> of your HTML page.
Copy the third section into a .css file.
You may edit that code to change the color scheme of the tabs.
The following gives an example:
|
Now, this is a simple example of how a tab control maybe used. In this case, I've inserted a lone image into the table area for each selection. Much more sophisticated examples are possible. But, back to how to do this.
As I said above, you'll have three sets of code to copy and paste into your web page and a CSS page.
In some cases, you then need to edit the guts of what you copy over.
You may shift the buttons around to any order you want.
what's important is that the pointer from the tab to the table is correct.
Add the Body of the Tab Control to the Body of your HTML Page
The first segment of code belongs in the <BODY> part of your HTML page.
Locate it at the position where you want the tab control.
Install the HTML File and the CSS File in the Same Directory
You may choose to name the CSS file differently or place it in a different directory.
If you do so, remember to update the href value on the link line in the header of your HTML page to point to the correct .css file.