Looking at the code, I don’t really see a reason for the extra class mention.
In fact they could have done something like
.sliderControl {
display: block;
height: 79px;
position: relative;
}
.sliderControl span {
position: absolute;
left: 0;
top: 0;
height: 100%; /*of Control, so 79px*/
width: 100%; /*430? width of Control or containing form element)*/
}
.sliderTrack {
background: url(slider_scale.jpg) 0 7px no-repeat; /*move bg image down 7px instead of different height... doesn't matter*/
}
.sliderThumb {
background-image: url(slider_thumb.gif);
cursor: w-resize;
height: 35px;
width: 20px;
}
.slider {
margin-left: 430px;
}
The way they have it is a little bit redundant and I think written for clarity. Though I’m not sure if adding the whole other span just for the thumb was for that reason… or maybe they originally had more class names and edited them out later.
I mean, they don’t even need sliderControl and sliderTrack at all. I could just make sliderControl hold the bg image of sliderTrack and so now there’s only 2 spans, one position-relative parent and one position-absolute child.
And then actually, since their wrapping all this in a label (not really recommended because some accessibility software still pukes on this), get rid of the outer span and just have
The above values would prolly get adjusted so label could have padding and stuff… but something like the above. Plus I can’t tell from the book where they expect the word “percentage” to go, so the values for the bg image prolly would need to accound for that anyway…
Unless the Javascript precludes that, but I dunno, the one span seemed to only exist to hold a bg image.
But so anyway, that extra class listing isn’t necessary in this case that I can see, and being a textbook it’s probably got a little bit more verbosity than you would ever really need.