This problem has consumed a lot of my time, and I'm aftraid someone
will tell me that my whole approach to this objective is wrong;
however, I would like to know if there is a way to do this.
I have a web page divided into two major segments, with the top segment
fixed and the bottom segment allowed to scroll, thus giving the look of
frames without frames.
I also have anchors so that users can click on a letter of the alphabet
to jump to the first item in the scrolling section that starts with the
selected letter.
Thus clicking on "B" in the alphabet at the top of the page jumps to
the word "Bore" which is the first item that starts with "B." This is
relatively simple and works well if the page is not segmented as I have
done.
The problem is that when the browser jumps down to an anchor target,
the target scrolls to the top of the browser window instead of the top
of the div, and is hidden underneath the top segment of the page. I
can't figure out how to make the anchor target jump up to the top of
the div so that it stops at the bottom of the top segment.
I'm a newbie as anybody can readily see, so if anybody has a
suggestion, please try to put it in kindergarten terms. Of course, if
this isn't possible, I'll just have to study your answer until I do
understand it.
My HTML code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript" type="text/javascript"></script><!--
The following line referring to robots is put there to keep search
engines from including
this page in any searches, so that this page is in essence private.-->
<meta name="robots" content="noindex,nofollow" />
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type" />
<link rel="stylesheet" type="text/css"
href="CopyOfShopratesInProgress.css" />
<title>Shop Rates</title>
</head>
<body>
<a id="topofpage"><font color="#ebecf6">x</font></a>
<!-- In the following line, I have made the font color of "x" the same
as the background color to make it invisible. I had trouble getting the
"top of page" links to work using home, since it is a link already. -->
<div id="topsection">
<br />
<table summary="Top section of this page" border="0" width="100%">
<tbody>
<tr>
<td> <a href="default.html"><small>Home</small></a></td>
</tr>
<!--This is a back and forward button using javascript, but I have
disabled it in favor of a regular link to the home page.--><!--<input
value="Back" onclick="history.go(-1)" type="button"></big><big><input
value="Forward" onclick="history.forward(-1)" type="button"></big>
--><!--end of back/forward button script -->
<tr>
<td><big><big><span class="title">SHOP
RATES</span></big></big></td>
</tr>
<tr>
<td> <small>Jump ahead alphabetically:</small></td>
</tr>
<tr>
<!-- The following <a href= statements are links to named anchors in
the page
so that the user can jump ahead alphabetically. The letters with no
<a href= statements have no anchors to link to.-->
<td><span class="alphabet">A</span>
B
<a href="#C">C</a>
<a href="#D">D</a>
<a href="#E">E</a>
F
<a href="#G">G</a>
<a href="#H">H</a>
<a href="#I">I</a>
J
<a href="#K">K</a>
<a href="#L">L</a>
<a href="#M">M</a>
N
<a href="#O">O</a>
<a href="#P">P</a>
Q
<a href="#R">R</a>
<a href="#S">S</a>
<a href="#T">T</a>
U
<a href="#V">V</a>
W X Y Z</td>
</tr>
<tr>
<td><big><big><span class="job">JOB</span></big></big>
</td>
<td><span class="code"><big><big>CODE</big></big></span></td>
<td><span class="price"><big><big>PRICE</big></big></span></td>
</tr>
</tbody>
</table>
</div>
<div id="bottomsection">
<span class="job">
<a name="B">BORE</a>BLOCK FOR SLEEVE </span>
<br />
<span class="code">BBS</span>
<span class="price">$</span>
<span class="comment">SLEEVE AND HONING OF </span>
<span class="comment">SLEEVE ARE EXTRA</span>
<hr align="left" width="550" /><span class="job">BRONZE GUIDES</span>
<br />
<span class="code">BG</span>
<span class="price">$</span>
<span class="comment">EACH GUIDE</span>
<hr align="left" width="550" />
<span class="job">
<a name="C">CAST</a>GUIDES</span>
<br />
<span class="code">CG</span> <span class="price">$</span>
<span class="comment">MACHINE AND INSTALL</span>
<hr align="left" width="550" />
<span class="job">CHECK LINE BORE</span>
<span class="code">CLB</span>
<span class="price">$</span>
<hr align="left" width="550" />
<span class="job">COMPRESS STRUT SPRINGS</span>
<br />
<span class="code">CSS</span>
<span class="price">$</span>
<span class="comment">EACH</span>
<hr align="left" width="550" /><span class="job">COOK AND
CLEAN HEADS</span>
<br />
<span class="code">HCA</span> <span class="price">$</span>
<span class="comment">AUTO AND PICKUP</span> <span
class="code">HCT4</span> <span class="price">$</span>
<span class="comment">TRUCK, 4-CYL HEAD</span> <span
class="code">HCT6</span> <span class="price">$</span>
<span class="comment">TRUCK, 6-CYL HEAD</span> <span
class="code">HCAAS</span> <span class="price">$</span>
<span class="comment">SMALL ALUMINUM</span> <span
class="code">HCAAL</span> <span class="price">$</span>
<span class="comment">LARGE ALUMINUM</span> <span
class="code">HCASE</span> <span class="price">$</span>
<span class="comment">SMALL ENGINE</span>
<hr align="left" width="550" /><span class="job">CUT OFF
BEARING</span><span class="code">CAB</span>
<span class="price">$</span> <br />
<hr align="left" width="550" />
<span class="job"><a name="D">DECK</a>BLOCK</span><br />
<span class="code">DBA</span> <span class="price">$</span>
<span class="comment">AUTO, PER CYLINDER</span>
<span class="topofpage"><a href="#topofpage">top of page</a></span>
<span class="code">DBT</span>
<span class="price">$</span>
<span class="comment">TRUCK, PER CYLINDER</span>
<hr align="left" width="550" />
<span class="job"><a name="E">ELECTRICAL</a>TEST</span>
<span class="code">ET</span>
<span class="price">$</span>
<br />
<hr align="left" width="550" /> <span class="job"><a name="G">GRIND</a>
VALVES</span> <br />
<span class="code">GV</span> <span class="price">$</span>
<span class="comment">PER VALVE</span>
<hr align="left" width="550" /><span class="job"><a
name="H">HELICOIL</a></span> <br />
<span class="code">HELA</span> <span class="price">$</span> <span
class="comment">AUTO
PER BOLT</span> <span class="code">HELT</span>
<span class="price">$</span> <span class="comment">TRUCK PER
BOLT</span>
<hr align="left" width="550" /><span class="job">HONE BLOCK
CYLINDER</span><br />
<span class="code">HBA1</span> <span class="price">$</span> <span
class="comment">.010
- .030 NON-INDUSTRIAL</span> <span class="code">HBA2</span>
<span class="price">$</span> <span class="comment">.030 - .060
NON-INDUSTRIAL</span> <span class="code">HBI1</span> <span
class="price">$</span>
<span class="comment">.010 - .030 INDUSTRIAL</span> <span
class="code">HBI2</span> <span class="price">$</span>
<span class="comment">.030 - .060 INDUSTRIAL</span>
<hr align="left" width="550" /><span class="topofpage"><a
href="#topofpage">top of page</a></span>
<span class="job">HONE
BLOCK CYLINDER, SMALL ENGINE</span><br />
<span class="code">HBSE10</span> <span class="price">$</span> <span
class="comment">TO
..010 OVER</span> <span class="code">HBSE20</span>
<span class="price">$</span> <span class="comment">TO .020 OVER</span>
<span class="code">HBSE30</span> <span class="price">$</span>
<span class="comment">TO .030 OVER</span> <span
class="code">HBSE40</span> <span class="price">$</span>
<span class="comment">TO .040 OVER</span> <span
class="code">HBSE50</span> <span class="price">$</span>
<span class="comment">TO .050 OVER</span>
<hr align="left" width="550" /><span class="job">HONE KING PINS</span>
<br />
<span class="code">HKP</span> <span class="price">$</span>
<span class="comment">AUTO</span> <span class="code">HKPT</span> <span
class="price">$</span>
<span class="comment">TRUCK</span>
<hr align="left" width="550" /><span class="job">HONE AND
INSTALL ROD BUSHINGS</span>
<br />
<span class="code">HRBA</span> <span class="price">$</span> <span
class="comment">AUTO</span>
<span class="topofpage"><a href="#topofpage">top of page</a></span>
<span class="code">HRBT</span>
<span class="price">$</span> <span class="comment">TRUCK</span>
<hr align="left" width="550" /><span class="job">HOT TANK
BLOCK (or <q>BAKE AND BLAST
BLOCK</q>)</span>
<br />
<span class="code">HTBA</span> <span class="price">$</span> <span
class="comment">AUTO
AND PICKUP</span> <span class="code">HTBT</span>
<span class="price">$</span> <span class="comment">TRUCK</span> <span
class="code">HTBSE</span>
<span class="price">$</span> <span class="comment">SMALL ENGINE</span>
<hr align="left" width="550" /><span class="job"><a
name="I">INSPECTION</a></span> <br />
<span class="code">I</span> <span class="price">$</span>
<span class="comment">AUTO AND PICKUP</span> <span
class="code">IT</span> <span class="price">$</span>
<span class="comment">TRUCK</span>
<hr align="left" width="550" /><span class="job">INSTALL
BEARING SLEEVES</span><br />
<br />
<span class="code">IBS</span> <span class="price">$</span>
<span class="comment">IN-LINE BORE ON BLOCK,<br />
PER BEARING SLEEVE</span>
<hr align="left" width="550" /><span class="job">INSTALL
INJECTOR TUBES</span><br />
<span class="code">IIT</span> <span class="price">$</span>
<span class="comment">PER TUBE</span>
<hr align="left" width="550" /><span class="job">INSTALL VALVE
SEATS</span> <br />
<span class="code">CHVS</span> <span class="price">$</span> <span
class="comment">PER
SEAT</span>
<hr align="left" width="550" /><span class="job"><a name="K">KNURL</a>
GUIDES</span> <br />
<span class="code">KG</span> <span class="price">$</span>
<span class="comment">PER GUIDE</span>
<hr align="left" width="550" /><span class="job"><a
name="L">LABOR</a></span> <br />
<span class="code">L</span> <span class="price">$</span>
<span class="comment">PER HOUR</span>
<hr align="left" width="550" /><span class="job">LINE BORE
BLOCK</span> <br />
<span class="code">LBA</span> <span class="price">$</span>
<span class="comment">AUTO</span>
<span class="code">LBB1</span> <span class="price">$</span> <span
class="comment">TRUCK
- ONE
SETUP, ONE CAP</span> <span class="code">LBB2</span>
<span class="price">$</span> <span class="comment">TRUCK - EACH
ADDITIONAL CAP</span>
<hr align="left" width="550" /><span class="job"><a
name="M">MACHINE</a>
COUNTER BORE</span>
<span class="code">MCB</span> <span class="price">$</span>
<hr align="left" width="550" /><span class="job">MACHINE FIRE
RING</span> <span class="code">MFR</span>
<span class="price">$</span>
<hr align="left" width="550" /> <span class="job">MAGNAFLUX</span>
<span class="code">MG</span> <span class="price">$</span>
<hr align="left" width="550" /><span class="job">MILEAGE</span><br />
<span class="code">M</span> <span class="price">$</span>
<span class="comment">PER MILE</span>
<hr align="left" width="550" /><span class="job"><a name="O">OTC</a>
HOOKUP</span> <span class="code">OTC</span>
<span class="price">$</span>
<hr align="left" width="550" /><span class="job">OVERSIZE
SEATS -- MACHINE OVERSIZE</span> <br />
<span class="code">OSVSA</span> <span class="price">$</span> <span
class="comment">AUTO,
PER SEAT</span> <span class="code">OSVST</span>
<span class="price">$</span> <span class="comment">TRUCK, PER
SEAT</span>
<hr align="left" width="550" /><span class="job"><a name="P">PICKUP</a>
AND DELIVERY</span>
<span class="code">PD</span> <span class="price">$</span>
<hr align="left" width="550" /><span class="job">PLANE HEAD
</span><br />
<span class="comment">PER CYLINDER</span>
<span class="code">HMA</span> <span class="price">$</span>
<span class="comment">AUTO</span> <span class="code">HMT</span> <span
class="price">$</span>
<span class="comment">TRUCK</span>
<hr align="left" width="550" /><span class="topofpage"> <a
href="#topofpage">top of page</a></span>
<span class="job">PRESS
AXLE BEARING</span>
<span class="code">AB</span> <span class="price">$</span>
<hr align="left" width="550" /> <span class="job">PRESSURE
CHECK HEAD</span> <br />
<span class="code">PCH</span> <span class="price">$</span>
<span class="comment">2-4 CYLINDERS</span> <span
class="code">PCH6</span> <span class="price">$</span>
<span class="comment">STRAIGHT 6 CYL'S</span>
<hr align="left" width="550" /><span class="job"><a
name="R">RECHARGE</a>
AIR CONDITIONING</span>
<br />
<span class="code">RA</span> <span class="price">$</span>
<span class="comment">REFRIGERANT EXTRA, <br />
NFR 13412</span>
<hr align="left" width="550" /><span class="job">RECONDITION
ROD</span> <br />
<span class="code">RCRA</span> <span class="price">$</span> <span
class="comment">AUTO,
EACH ROD</span> <span class="code">RCRT</span>
<span class="price">$</span> <span class="comment">TRUCK, EACH
ROD</span>
<hr align="left" width="550" /><span class="job">REFACE
FLYWHEEL</span> <br />
<span class="code">RFFA1</span> <span class="price">$</span> <span
class="comment">AUTO,
FLAT FLYWHEEL</span> <span class="code">RFFT1</span>
<span class="price">$</span> <span class="comment">TRUCK, FLAT
FLYWHEEL</span> <span class="code">RFFA2</span> <span
class="price">$</span>
<span class="comment">AUTO, RECESSED FLYWHEEL</span>
<span class="code">RFFT2</span> <span class="price">$</span> <span
class="comment">TRUCK,
RECESSED FLYWHEEL</span>
<hr align="left" width="550" /><span class="job">R/R CAM
BEARINGS</span> <span class="code">RRCB</span>
<span class="price">$</span>
<hr align="left" width="550" /><span class="job">R/R GUIDE,
PRESS OUT AND INSTALL</span>
<br />
<span class="code">RRVGA</span> <span class="price">$</span> <span
class="comment">AUTO,
PER GUIDE</span> <span class="code">RRVGT</span>
<span class="price">$</span> <span class="comment">TRUCK, PER
GUIDE</span>
<hr align="left" width="550" /> <span class="topofpage"><a
href="#topofpage">top of page</a></span>
<span class="job">R/R PISTON</span> <br />
<span class="code">RRPA1</span> <span class="price">$</span> <span
class="comment">AUTO,
ONE PISTON ONLY</span> <span class="code">RRPA</span>
<span class="price">$</span> <span class="comment">AUTO, PER PISTON,
<br />
MULITPLE PISTONS</span> <span class="code">RRPT</span>
<span class="price">$</span> <span class="comment">TRUCK, PER
PISTON</span>
<hr align="left" width="550" /><span class="job">R/R SMALL
ENGINE CRANKSHAFT</span>
<br />
<span class="code">RSEC</span> <span class="price">$</span> <span
class="comment">SINGLE
CYLINDER</span> <span class="code">RSEC2</span>
<span class="price">$</span> <span class="comment">TWIN CYLINDER</span>
<hr align="left" width="550" /><span class="job">R/R VALVE
SEATS</span><br />
<span class="code">RRSVA</span> <span class="price">$</span> <span
class="comment">AUTO,
PULL OUT & INSTALL, <br />
<font color="red"> NO MACHINE WORK</font></span>
<span class="code">RRSVT</span> <span class="price">$</span> <span
class="comment">TRUCK,
PULL OUT & INSTALL,<br />
<font color="red"> NO MACHINE WORK</font></span>
<hr align="left" width="550" /><span class="job"><a
name="S">SHARPEN</a>
CHAINSAW BLADE</span>
<span class="code">SHARP</span> <span class="price">$</span>
<hr align="left" width="550" /> <span class="job">SLEEVE BORE
MOTORCYCLE<br />
OR 4-WHEELER</span> <span class="code">SBM</span>
<span class="price">$</span>
<hr align="left" width="550" /><span class="job"><a name="T">TURN</a>
DRUM</span> <br />
<span class="code">TDA</span> <span class="price">$</span>
<span class="comment">AUTO</span> <span class="code">TDST</span> <span
class="price">$</span>
<span class="comment">SMALL TRUCK</span> <span class="code">TDT</span>
<span class="price">$</span>
<span class="comment">TRUCK</span> <span class="code">TLTD</span> <span
class="price">$</span>
<span class="comment">LARGE TRUCK DRUM</span>
<hr align="left" width="550" /> <span class="topofpage"><a
href="#topofpage">top of page</a></span>
<span class="job">TURN ROTOR</span> <br />
<span class="code">TR</span> <span class="price">$</span>
<span class="comment">AUTO</span> <span class="code">TRST</span> <span
class="price">$</span>
<span class="comment">SMALL TRUCK</span> <span class="code">TRT</span>
<span class="price">$</span>
<span class="comment">TRUCK</span>
<hr align="left" width="550" /><span class="job"><a name="V">VALVE</a>
JOB</span> <br />
<span class="comment">PER CYLINDER</span> <span class="code">VJA</span>
<span class="price">$</span>
<span class="comment">AUTO</span> <span class="code">VJT2</span> <span
class="price">$</span>
<span class="comment">TRUCK, 2 VALVES PER CYL</span>
<span class="code">VJT4</span> <span class="price">$</span> <span
class="comment">TRUCK,
4 VALVES PER CYL</span> <span class="code">VJT6</span>
<span class="price">$</span> <span class="comment">TRUCK, 6 VALVES PER
CYL</span> <span class="code">VJSE</span> <span class="price">$</span>
<span class="comment">SINGLE CYLINDER</span> <span
class="code">VJSE</span> <span class="price">$</span>
<span class="comment">TWIN CYLINDER</span>
<hr align="left" width="550" /><!--<input value="Back"
onclick="history.go(-1)" type="button"></big><big><input
value="Forward" onclick="history.forward(-1)" type="button"></big>
--><br />
<br />
<span class="topofpage"><a href="#topofpage">top
of page</a></span>
<br />
<br />
<a href="default.html"><small>Home</small></a></div>
</body>
</html>
The related CSS code for this page is:
div#topsection { position:fixed;
top: 0pt;
background-color: rgb(206, 255, 255);
width:100%;
z-index:2;
}
div#bottomsection {position:absolute;
top:165px;
z-index:1;
}
span.topofpage { display: block;
position: absolute;
right: -20%;
}
span.alphabet { padding: 1px;
background-color: rgb(206, 255, 255);
font-weight: normal;
color: black;
display: inline;
}
span.title { font-weight: bold;
color: black;
display: block;
position: relative;
}
span.job { font-weight: bold;
color: rgb(0, 75, 24);
display: inline;
}
span.code { font-weight: bold;
color: blue;
display: inline;
position: absolute;
left: 350px;
}
span.price { font-weight: bold;
color: red;
display: inline;
position: absolute;
left: 450px;
}
span.comment { color: purple;
display: block;
position: relative;
left: 4em;
}
div.total { position: relative;
left: 25%;
}
a:link { color: red;
}