The problem is as soon as I put a doctype tag into the html, that stops working.
Without the doctype, it's good, so it's not the CSS. And the rest of the script works, so it's not that the script has been disallowed. :S
Could be the syntax? But I'm newish to scripting, so I'm not too sure. Lol...