Skip to content

Revert back to <!doctype html> ? #1522

@alrra

Description

@alrra

Previous discussions

Commit in which the change was made: 7a2f9dc
Relevant issues: #335, #1059.

Specification, browsers and validators

From WHATWG

A DOCTYPE must consist of the following components, in this order:

  1. A string that is an ASCII → case-insensitive ← match for the string "<!DOCTYPE".
  2. One or more space characters.
  3. A string that is an ASCII → case-insensitive ← match for the string "html".
  4. Optionally, a DOCTYPE legacy string or an obsolete permitted DOCTYPE string (defined below).
  5. Zero or more space characters.
  6. A U+003E GREATER-THAN SIGN character (>).

In other words, , case-insensitively.

So, according to the specification, the case doesn't matter. Also, browsers (AFAIK) don't really care, and the W3C validator is fine with either case.

Pros and cons for using <!doctype html>

Pros:

Cons:

  • some IDEs/text editors complain about the syntax (IMHO this shouldn't be a concern for H5BP, as it represents a bug in the IDE/text editor, and thus, it should be fixed by them. Going on this path, one can argue that we shouldn't use CSS3 features because some IDEs/text editors complain about the new syntax).
  • the uppercase form is more commonly used, and thus, it doesn't make developers wonder/curious.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions