Use The HTML5 Doctype
ID |
html.doctype_html5 |
Severity |
low |
Remediation Complexity |
low |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Reliability |
Language |
Html |
Tags |
reliability |
Rationale
The legacy XHTML and HTML 4.01 doctypes carry public and system identifiers that pin the document to
an obsolete DTD. Modern browsers ignore those identifiers but the verbose, transitional forms add
noise and can trip older tooling, while only the short <!DOCTYPE html> form is guaranteed to select
standards mode unambiguously.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "..."> <!-- FLAW — legacy doctype -->
<!DOCTYPE html> <!-- OK — HTML5 doctype -->