Obviously, the contents/tags within <head></head> pair will be attached to Head element.
Is there any situation in which during the parsing of <body></body>, some elements would be attached to Head element, instead of Body element?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the HTML5 parsing algorithm, no, except via injection by script. Some older browsers may move such elements though. For example see the thread that starts at http://lists.w3.org/Archives/Public/public-html/2007May/1066.html and in particular http://lists.w3.org/Archives/Public/public-html/2007May/1081.html
However, there is the case of what happens to an element that’s normally in head, appears either before the
<head>tag, or after the</head>tag but before the body element is created, for instance http://software.hixie.ch/…. In this situation, the element will be moved inside the head element.Note that elements between the
<head>and</head>tags can easily end up not inside the head element due to invalid mark up, for instance, http://software.hixie.ch/…