I had this problem.
The solution to this problem, in my case, was to include
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN" "https://www.w3.org/TR/html4/loose.dtd ">
in header.php.
I had forgotten to include the Doctype.
Hope that helps