elements-not-allowed-in-head

⌘K
  1. Home
  2. SiteLint
  3. Accessibility Rules
  4. elements-not-allowed-in-head

elements-not-allowed-in-head

Print this article

Description

This rule verifies if there are elements that shouldn’t be in the <head> section.

    Context

    <head> section contains elements that provide information of how the document should be perceived, and rendered, by web technologies. e.g. browsers, search engines, bots, screen readers, etc.

    Non-valid pages rely on the browser to auto-correct your code, and each browser does this differently. If your code is valid, the browser has to do less processing as it doesn’t have to correct any code, therefore, the page will render faster and be more predictable.

    In order to make the code accurately processed and rendered, it is recommended to have only valid HTML elements/tags in the <head> section.

    Following elements are allowed to be in the <head> section:

    • <title>
    • <base>
    • <link>
    • <style>
    • <meta>
    • <script>
    • <noscript>
    • <template>

    All other elements/tags are perceived as non-valid.

    How to fix it

    The rule passes when only following elements/tags are specified in the <head> section:

    • <title>
    • <base>
    • <link>
    • <style>
    • <meta>
    • <script>
    • <noscript>
    • <template>

    Techniques

    Not Applicable

    Was this article helpful to you? No Yes

    How can we help?