What happens to my SEO and scripts if the <HEAD> tag was below my <BODY> tag?

Just think about it, the XHTML1.1 spec and the extension, HTML5 (assume) ... well Markup is designed in such a way that, unless otherwise stated, "order" shouldn't matter.

Everything in the Body tag is explicitly ordered in a certain way of interpreting the browser rendering engine, but the HEAD and BODY tags by themselves have nothing to do with the rendering order (despite their name and additionally being included in the HEAD; include, depends on the other, which, obviously need to be loaded first) and thus follow the same rules as any markup language.

Throwing a block of HEAD tags under a block of BODY tags works (at least in WebKit based browsers), but all I've managed to do so far is to check that the title tag works as it should. Not exactly a good test, but as I write this on my phone, I didn't have time to go any further with my thought process.

I'm wondering how this will affect SEO, and even worse: loading Script and CSS files normally rendered in HEAD. I understand that the practice lately has external loading of Script files occurring at the bottom of the markup or next to it to delay their loading, when the page is ready, would this react differently?

Basically I ask, "What are the * implications" of having a website where the HEAD block is below the BODY block?

<html>
    <body>
        Test
    </body>
    <head>
        <title>Test</title>
        <script src="test.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="test.css" />
    </head>
</html>

      

+3


source share


2 answers


This will only have a negative impact on SEO, if any.

First, your suggestion results in incorrect HTML. The DTD HTML4.01, which strictly defines the structure of HTML documents, specifies what <head>

becomes before <body>

:

<!ENTITY % html.content "HEAD, BODY">

      



(If the order doesn't matter, then it will <!ENTITY % html.content "(HEAD|BODY)+">

Second, I would bet that most spiders are looking for an element <head>

as quickly as possible, if they can't find it in front of the element <body>

, then it will probably most likely downgrade your document if you don't completely ignore it. I suspect that most spiders ignore whatever comes <head>

after <body>

.

Third, it destroys the user experience. Sometimes the pages can take a while, but the browser parses the HTML as it loads. Once it sees it <title>

, it will display it to the user so that the user knows that the page is at least partially loaded (even if it hasn't been rendered yet). Without this capability, your users might close the browser tab / window out of frustration if it loads too slowly as they think the site is completely unresponsive.

+3


source


Interesting question, but I strongly believe that the structure of HTML is very similar to human anatomy (Head-Body-foot), what happens and how does it look if it is not in the correct structure? Looks ugly, hard to identify a specific person, here the browser acts according to a generic structure (eg head-body-footer), so it's a bit of a predefined structure that we need to follow for best results.



As far as SEO is concerned, working offline SEO in such a case is how we follow the structure and of course it will affect Google spider and more.

0


source







All Articles