Is it okay to place HTML code between the ending of the head area and before the beginning of the body area. I have done this before, on various sites without any problems, however, I would like to know whether this has any backwards compatibility issues, and also whether this is common, or good practice. For example:
</head>
<div id="header">
<h1>Heading</h1>
Code & Content...
</div><!-- #header -->
<body>
Code & Content...
</body>
No, is not okay. All the content of the page should go inside <body>
. Check the HTML specification.
Browsers are really forgiving, but even if it works you shouldn't do it.