Copy and paste the following Paragraph (PBUTTON) and Anchor (PBUTTONA) CSS Style definitions in between the <HEAD> and </HEAD> tags at the top of your HTML page:
<style> <!-- .PBUTTON { font-family: arial, helvetica, sans-serif; font-size: 90%; /* larger | smaller | 100% */ font-style: normal; /* italic | normal */ text-align: center; /* left | center | right */ /* width: 100px; */ /* 6em | 100% | auto */ border-style: outset; /* none | dotted | dashed | solid | double | groove | ridge | inset | outset */ border-width: thick ; /* thin | medium | thick | 4px | 1em | 1ex */ background-color: #582800; /* rgb(85,43,0); */ border-color: #885830; /* rgb(135,90,45); */ color: #D0D098; /* rgb(204,204,153); */ } A.PBUTTONA /* class for linking an Anchor tag to a PBUTTON Paragraph */ { text-decoration: none; /* none | underline | overline | line-through | blink */ } A.PBUTTONA:LINK { color: #F0F0D0; /* rgb(240,240,208); */ } A.PBUTTONA:VISITED { color: #D0D098; /* rgb(204,204,153); */ } A.PBUTTONA:ACTIVE { color: #FFA038; /* rgb(255,160,56); */ } A.PBUTTONA:HOVER { color: #FFA038; /* rgb(255,160,56); */ } !--> </style>
Copy and paste the following JavaScript PBUTTONobject definition and declaration just before the </BODY> and </HTML> tags at the bottom of your HTML page:
<script language="JavaScript1.2"><!-- MSIEPButton = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )); if (MSIEPButton){ if (document.all){ // msie4 only /* ------------------------------------------------------------------------------------ */ /* line 1) Based on original PBUTTONobject code, Copyright John E Schimpf 12/23/1998. */ /* line 2) If you retain these 3 lines, you may: use, copy, alter, distribute, sell, */ /* line 3) re-use, re-copy, re-alter, re-distribute, re-sell; this code free of charge. */ /* ------------------------------------------------------------------------------------ */ /* PBUTTONAobject definition JES 12/23/98 */ function PBUTTONAmatchPBUTTON(thePBUTTONObject){ var i=0;for(i=thePBUTTONObject.allPBUTTONs.length-1;i>-1;i-=1){ if(thePBUTTONObject.allPBUTTONs[i].contains(this.srcElement)) {this.PBUTTONelement=thePBUTTONObject.allPBUTTONs[i];break;}}} function PBUTTONAobject(PBUTTONAelement,thePBUTTONObject){ this.srcElement =PBUTTONAelement; this.PBUTTONelement=null; this.matchPBUTTON =PBUTTONAmatchPBUTTON; this.savemouseout =null; this.savemouseover=null; this.savemousedown=null; if(PBUTTONAelement.onmouseout )this.savemouseout =PBUTTONAelement.onmouseout; if(PBUTTONAelement.onmouseover)this.savemouseover=PBUTTONAelement.onmouseover; if(PBUTTONAelement.onmousedown)this.savemousedown=PBUTTONAelement.onmousedown; PBUTTONAelement.onmouseout =thePBUTTONObject.mouseHandler; PBUTTONAelement.onmouseover=thePBUTTONObject.mouseHandler; PBUTTONAelement.onmousedown=thePBUTTONObject.mouseHandler; this.matchPBUTTON(thePBUTTONObject);} /* PBUTTONobject definition JES 12/23/98 */ function PBUTTONmouseHandler(theObjectName){ var i=0;var theElement;var thePBUTTON;var thePBUTTONA; var theObject;eval("theObject="+theObjectName); if(event){if(event.srcElement){theElement=event.srcElement; for(i=0;i<theObject.allPBUTTONAs.length;i++){thePBUTTONA = theObject.allPBUTTONAs[i]; if(thePBUTTONA.PBUTTONelement){thePBUTTON=thePBUTTONA.PBUTTONelement; if(thePBUTTON.contains(theElement)){ if(event.type=="mouseout"){ thePBUTTON.style.borderStyle="outset"; if(thePBUTTONA.savemouseout) return thePBUTTONA.savemouseout();} if(event.type=="mouseover"){ thePBUTTON.style.borderStyle="groove"; if(thePBUTTONA.savemouseover)return thePBUTTONA.savemouseover();} if(event.type=="mousedown"){ thePBUTTON.style.borderStyle="inset"; if(thePBUTTONA.savemousedown)return thePBUTTONA.savemousedown();} }}}}}return true;} function PBUTTONobject(ObjectName,PBUTTONclassName,PBUTTONAclassName){ this.name=ObjectName; this.mouseHandler=new Function("return PBUTTONmouseHandler(\""+this.name+"\");"); this.allPBUTTONs =new Array(); this.allPBUTTONAs=new Array(); var i=0;var j=0;var k=0;var jes=12/23/98; for(i=0;i<document.all.length;i++){ if(document.all(i).className==PBUTTONclassName){ this.allPBUTTONs[j]=document.all(i);j++;} else if(document.all(i).className==PBUTTONAclassName){ this.allPBUTTONAs[k]=new PBUTTONAobject(document.all(i),this); k++;}} for(i=0;i<this.allPBUTTONAs.length;++i){ if(!this.allPBUTTONAs[i].PBUTTONelement)this.allPBUTTONAs[i].matchPBUTTON(this);}} /* ----------------------------------------------------------------------------------------- */ /* instantiate a PBUTTONobject to handle your buttons JES 12/23/98 */ /* var ObjectName = new PBUTTONobject("ObjectName","PBUTTONclassName","PBUTTONAclassName") */ /* ObjectName = the name of the variable you are creating */ /* PBUTTONclassName = Paragraph style className used in the HTML */ /* PBUTTONAclassName= Anchor block style className used in the HTML */ var buttonBar = new PBUTTONobject("buttonBar","PBUTTON","PBUTTONA"); } } //--></script>
Create a table with a cell to contain each button:
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> . . . .
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table>
Add the text and/or images you want on your buttons to each table cell (button):
<td>Overview </td> <td>Instructions </td> <td>Tips </td> <td>Details </td> Overview Instructions Tips Details
<td>Overview </td> <td>Instructions </td> <td>Tips </td> <td>Details </td>
Make the text and images for each button into a single hyperlink, to the URL where you want your buttons to link to.
<td><a href="rpbbar.htm">Overview </a></td> <td><a href="rpbbari.htm">Instructions </a></td> <td><a href="rpbbart.htm">Tips </a></td> <td><a href="rpbbard.htm">Details </a></td>
Overview Instructions Tips Details
Set the background color of each table cell to the color you want for your button. There are 2 ways to do this for compatability with older browsers:
In cell properties, set the background color of the cell: <td bgcolor="#582800"><a href="rpbbar.htm">Overview </a></td> In cell properties, click on the style button, and set the background color in the style properties: <td style="background-color: rgb(88,40,0)"><a href="rpbbari.htm">Instructions </a></td>
In cell properties, set the background color of the cell:
<td bgcolor="#582800"><a href="rpbbar.htm">Overview </a></td>
In cell properties, click on the style button, and set the background color in the style properties:
<td style="background-color: rgb(88,40,0)"><a href="rpbbari.htm">Instructions </a></td>
The first method will show the color if the browser supports it, the second method will show the page background in older browsers.
<td bgcolor="#582800"><a href="rpbbar.htm">Overview </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbari.htm">Instructions </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbart.htm">Tips </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbard.htm">Details </a></td> Overview Instructions Tips Details
<td bgcolor="#582800"><a href="rpbbar.htm">Overview </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbari.htm">Instructions </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbart.htm">Tips </a></td> <td style="background-color: rgb(88,40,0)"><a href="rpbbard.htm">Details </a></td>
The next step is to assign a Block Text HTML element to the contents of each button. I use <ADDRESS> because it intrinsically doesn't have trailling paragraph spacing in most browsers. Put your cursor on the text of a cell, then using the FrontPage Format Toolbar, set the paragraph style to Address. Do this to each cell containing a button.
<td bgcolor="#582800"><address><a href="rpbbar.htm">Overview </a></address></td> Overview Instructions Tips Details This stage completes the base HTML layer for the buttons, and is how your buttons will appear in older browsers.
<td bgcolor="#582800"><address><a href="rpbbar.htm">Overview </a></address></td>
This stage completes the base HTML layer for the buttons, and is how your buttons will appear in older browsers.
For each button cell, assign the PBUTTON style to the Address element, and PBUTTONA to the Anchor element.
Put your cursor on the text of a cell, click your right mouse button, and open Paragraph Properties. Push the Style push button, and set the class to PBUTTON. <td bgcolor="#582800"><address class="PBUTTON"><a href="rpbbar.htm">Overview </a></address></td> Similarly, open the Hyperlink Properties for each button cell, push the Style push button, and set the class to PBUTTONA. <td bgcolor="#582800"><address class="PBUTTON"><a href="rpbbar.htm" class="PBUTTONA">Overview </a></address></td> Overview Instructions Tips Details
Put your cursor on the text of a cell, click your right mouse button, and open Paragraph Properties. Push the Style push button, and set the class to PBUTTON.
<td bgcolor="#582800"><address class="PBUTTON"><a href="rpbbar.htm">Overview </a></address></td>
Similarly, open the Hyperlink Properties for each button cell, push the Style push button, and set the class to PBUTTONA.
<td bgcolor="#582800"><address class="PBUTTON"><a href="rpbbar.htm" class="PBUTTONA">Overview </a></address></td>
The basic button bar should be working in MS Internet Explorer 4.x (with my colors) at this stage.
To change the colors of the button bar, go to the top of the HTML page where the PBUTTON style is defined:
<style><!-- P.PBUTTON { . . . background-color: rgb(85,43,0); border-color: rgb(135,90,45); color: rgb(204,204,153); }
background-color: Sets the color for the face of the button. border-color: Sets the color for the sides of the button. color: Sets the color for normal text (not part of a link).
To change the color of the text on the button bar, go to the top of the HTML page where the PBUTTONA link styles are defined:
A.PBUTTONA:LINK { color: rgb(240,240,208); } A.PBUTTONA:VISITED { color: rgb(204,204,153); } A.PBUTTONA:ACTIVE { color: rgb(255,160,56); } A.PBUTTONA:HOVER { color: rgb(255,160,56); }
The LINK, VISITED, ACTIVE colors, control the color of the Link text on the buttons. The HOVER color only works in Internet Explorer 4.x, and is the color used when the mouse is over the link.
To set the size of the buttons:
In MS Internet Explorer 4.x, the size of a button is controlled by the size of the table cell for the button. In Netscape 4.x, the size is controlled in the PBUTTON style definition. Un-comment the width: specification and set the size to what looks good: P.PBUTTON { font-size: 90%; /* larger | smaller | 100% */ width: 100px; /* 6em | 100% | auto */
In MS Internet Explorer 4.x, the size of a button is controlled by the size of the table cell for the button.
In Netscape 4.x, the size is controlled in the PBUTTON style definition. Un-comment the width: specification and set the size to what looks good:
P.PBUTTON { font-size: 90%; /* larger | smaller | 100% */ width: 100px; /* 6em | 100% | auto */
The font-size: specification in the PBUTTON style definition, controlls the size of the font on the buttons.
[Home] [ScrapBook] [Chat] [Links] [Contact] [FrontPage] This page hosted by Get your own Free Home Page JES - 05/15/99