I had the same problem and spent ages going over the code like you did.
I did find the reason why it works on Marco's version.
It's the block of javascript he inserted at the top of the Template.master file.
Quote:
quote:
Code:
<script type="text/javascript">
/* <![CDATA[ */
function AdjustColumnsHeight()
{
// get a reference to the three DIVS that make up the columns
var centerCol = window.document.getElementById('centercol');
var leftCol = window.document.getElementById('leftcol');
var rightCol = window.document.getElementById('rightcol');
// calculate the max height
var hCenterCol = centerCol.offsetHeight;
var hLeftCol = leftCol.offsetHeight;
var hRightCol = rightCol.offsetHeight;
var maxHeight = Math.max(hCenterCol, Math.max(hLeftCol, hRightCol));
// set the height of all 3 DIVS to the max height
centerCol.style.height = maxHeight + 'px';
leftCol.style.height = maxHeight + 'px';
rightCol.style.height = maxHeight + 'px';
// Show the footer
window.document.getElementById('footer').style.visibility = 'inherit';
}
window.onload = function() { AdjustColumnsHeight(); }
/* ]]> */
</script>
|
Actually, it's just this line that's revealing the footer:
Code:
window.document.getElementById('footer').style.visibility = 'inherit';
I did a couple quick checks, and it seems that you need the AdjustColumnsHeight() function in order for the footer to be placed properly at the bottom of the page without overlap from the columns.
However, there doesn't seem to be any reason to "reveal" the footer with that code; it works just fine for me if I set the footer to "visible" on the style sheet and comment-out the above line in the Template.master javascript that changes the visibility. Seems to me like it should probably have just been left set to "visible" on the style sheet to avoid confusion.
He should have also included that javascript in Ch 2 to save folks the frustration of figuring out why their page doesn't look like the picture at the end of the chapter, and has no footer.
Btw, does anyone know what the commented-out lines at the top and bottom of the script are there for?