Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1095

"<!DOCTYPE>" declarations should appear before "<html>" tags

    XMLWordPrintable

    Details

    • Type: Bug Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Insert a <!DOCTYPE> declaration before this <html> tag.
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      DoctypePresenceCheck
    • Covered Languages:
      HTML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min

      Description

      The <!DOCTYPE> declaration tells the web browser which (X)HTML version is being used on the page, and therefore how to interpret the various elements.
      Validators also rely on it to know which rules to enforce.
      It should always preceed the <html> tag.

      Noncompliant Code Example

      <html>  <!-- Noncompliant -->
      ...
      </html>
      

      Compliant Solution

      <!DOCTYPE html>
      <html>  <!-- Compliant -->
      ...
      </html>
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            freddy.mallet Freddy Mallet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: