1. Home
  2. Docs
  3. SiteLint
  4. Accessibility Rules
  5. 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 provides 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 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? Yes No