Skip to content

What happens when a page does not have a DOCTYPE? #10

@sebdeckers

Description

@sebdeckers

Modern documents begin with the HTML 5 doctype declaration:

<!doctype html>

Really old documents did not contain this declaration. Because modern standards can not expect all older documents to be updated, browsers instead assume that any document lacking a doctype declaration is an old document.

Old documents did not render according to the rules of HTML5. There were differences and ambiguities in how HTML, CSS, and JS behaved. So modern browsers switch to a backwards compatible method called "quirks mode" when encountering a page without a doctype.

As a reference, these are the commonly encountered doctype declarations for HTML 4, XHTML, and HTML 5:
https://css-tricks.com/snippets/html/the-common-doctypes/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions