modified some things based on analysis by this validator. https://validator.w3.org Though I think the main problem is that there was an unclosed <div>. I think what may be happening is that there might be an open div in the header and then a closed div in the footer. Or there's not. And then each thing thats inserted in between the header and footer may or may not have starting and closing <div>. I need to go through and check though.
Also, the hidden state mod is from here -
http://w3c.github.io/html/single-page.html#hidden-state-typehidden