Table of contents

  1. 1 Introduction
    1. 1.1 Is this HTML5?
    2. 1.2 Background
    3. 1.3 Audience
    4. 1.4 Scope
    5. 1.5 History
    6. 1.6 Design notes
      1. 1.6.1 Extensibility
    7. 1.7 HTML vs XML syntax
    8. 1.8 Structure of this specification
      1. 1.8.1 Typographic conventions
    9. 1.9 A quick introduction to HTML
      1. 1.9.1 Writing secure applications with HTML
      2. 1.9.2 Common pitfalls to avoid when using the scripting APIs
      3. 1.9.3 How to catch mistakes when writing HTML: validators and conformance checkers
    10. 1.10 Conformance requirements for authors
      1. 1.10.1 Presentational markup
      2. 1.10.2 Syntax errors
      3. 1.10.3 Restrictions on content models and on attribute values
    11. 1.11 Suggested reading
  2. 2 Common infrastructure
    1. 2.1 Terminology
      1. 2.1.1 Resources
      2. 2.1.2 XML compatibility
      3. 2.1.3 DOM trees
      4. 2.1.4 Scripting
      5. 2.1.5 Plugins
      6. 2.1.6 Character encodings
      7. 2.1.7 Dependencies
      8. 2.1.8 Extensibility
    2. 2.2 Policy-controlled features
    3. 2.3 Common microsyntaxes
      1. 2.3.1 Boolean attributes
      2. 2.3.2 Keywords and enumerated attributes
      3. 2.3.3 Numbers
        1. 2.3.3.1 Signed integers
        2. 2.3.3.2 Non-negative integers
        3. 2.3.3.3 Floating-point numbers
        4. 2.3.3.4 Lists of floating-point numbers
      4. 2.3.4 Dates and times
        1. 2.3.4.1 Months
        2. 2.3.4.2 Dates
        3. 2.3.4.3 Yearless dates
        4. 2.3.4.4 Times
        5. 2.3.4.5 Local dates and times
        6. 2.3.4.6 Time zones
        7. 2.3.4.7 Global dates and times
        8. 2.3.4.8 Weeks
        9. 2.3.4.9 Durations
        10. 2.3.4.10 Vaguer moments in time
      5. 2.3.5 Space-separated tokens
      6. 2.3.6 Comma-separated tokens
      7. 2.3.7 References
      8. 2.3.8 Media queries
      9. 2.3.9 Unique internal values
    4. 2.4 URLs
      1. 2.4.1 Terminology
      2. 2.4.2 CORS settings attributes
      3. 2.4.3 Referrer policy attributes
      4. 2.4.4 Nonce attributes
      5. 2.4.5 Lazy loading attributes
      6. 2.4.6 Blocking attributes
      7. 2.4.7 Fetch priority attributes
    5. 2.5 Common DOM interfaces
      1. 2.5.1 Reflecting content attributes in IDL attributes
      2. 2.5.2 Collections
        1. 2.5.2.1 The HTMLAllCollection interface
        2. 2.5.2.2 The HTMLFormControlsCollection interface
        3. 2.5.2.3 The HTMLOptionsCollection interface
      3. 2.5.3 The DOMStringList interface
    6. 2.6 Safe passing of structured data
      1. 2.6.1 Serializable objects
      2. 2.6.2 Transferable objects
      3. 2.6.3 Structured cloning API
  3. 3 Semantics, structure, and APIs of HTML documents
    1. 3.1 Documents
      1. 3.1.1 The Document object
      2. 3.1.2 The DocumentOrShadowRoot interface
      3. 3.1.3 Ancestor origins
      4. 3.1.4 Resource metadata management
      5. 3.1.5 Reporting document loading status
      6. 3.1.6 Render-blocking mechanism
      7. 3.1.7 DOM tree accessors
    2. 3.2 Elements
      1. 3.2.1 Semantics
      2. 3.2.2 Elements in the DOM
      3. 3.2.3 Element definitions
        1. 3.2.3.1 Attributes
      4. 3.2.4 Content models
        1. 3.2.4.1 The "nothing" content model
        2. 3.2.4.2 Kinds of content
          1. 3.2.4.2.1 Metadata content
          2. 3.2.4.2.2 Flow content
          3. 3.2.4.2.3 Sectioning content
          4. 3.2.4.2.4 Heading content
          5. 3.2.4.2.5 Phrasing content
          6. 3.2.4.2.6 Embedded content
          7. 3.2.4.2.7 Interactive content
          8. 3.2.4.2.8 Palpable content
          9. 3.2.4.2.9 Script-supporting elements
        3. 3.2.4.3 Transparent content models
        4. 3.2.4.4 Paragraphs
      5. 3.2.5 Global attributes
        1. 3.2.5.1 The title attribute
        2. 3.2.5.2 The lang and xml:lang attributes
        3. 3.2.5.3 The translate attribute
        4. 3.2.5.4 The dir attribute
        5. 3.2.5.5 The style attribute
        6. 3.2.5.6 Embedding custom non-visible data with the data-* attributes
      6. 3.2.6 The innerText and outerText properties
      7. 3.2.7 Requirements relating to the bidirectional algorithm
  4. 4 The elements of HTML
    1. 4.1 The document element
      1. 4.1.1 The html element
    2. 4.2 Document metadata
      1. 4.2.1 The head element
      2. 4.2.2 The title element
      3. 4.2.3 The base element
      4. 4.2.4 The link element
        1. 4.2.4.1 Providing users with a means to follow hyperlinks created using the link element
      5. 4.2.5 The meta element
        1. 4.2.5.1 Standard metadata names
        2. 4.2.5.2 Other metadata names
        3. 4.2.5.3 Pragma directives
        4. 4.2.5.4 Specifying the document's character encoding
      6. 4.2.6 The style element
    3. 4.3 Sections
      1. 4.3.1 The body element
      2. 4.3.2 The article element
      3. 4.3.3 The section element
      4. 4.3.4 The nav element
      5. 4.3.5 The aside element
      6. 4.3.6 The h1, h2, h3, h4, h5, and h6 elements
      7. 4.3.7 The hgroup element
      8. 4.3.8 The header element
      9. 4.3.9 The footer element
      10. 4.3.10 The address element
      11. 4.3.11 Headings and outlines
        1. 4.3.11.1 Heading levels & offsets
        2. 4.3.11.2 Sample outlines
        3. 4.3.11.3 Exposing outlines to users
      12. 4.3.12 Usage summary
        1. 4.3.12.1 Article or section?
    4. 4.4 Grouping content
      1. 4.4.1 The p element
      2. 4.4.2 The hr element
      3. 4.4.3 The pre element
      4. 4.4.4 The blockquote element
      5. 4.4.5 The ol element
      6. 4.4.6 The ul element
      7. 4.4.7 The menu element
      8. 4.4.8 The li element
      9. 4.4.9 The dl element
      10. 4.4.10 The dt element
      11. 4.4.11 The dd element
      12. 4.4.12 The figure element
      13. 4.4.13 The figcaption element
      14. 4.4.14 The main element
      15. 4.4.15 The search element
      16. 4.4.16 The div element
    5. 4.5 Text-level semantics
      1. 4.5.1 The a element
      2. 4.5.2 The em element
      3. 4.5.3 The strong element
      4. 4.5.4 The small element
      5. 4.5.5 The s element
      6. 4.5.6 The cite element
      7. 4.5.7 The q element
      8. 4.5.8 The dfn element
      9. 4.5.9 The abbr element
      10. 4.5.10 The ruby element
      11. 4.5.11 The rt element
      12. 4.5.12 The rp element
      13. 4.5.13 The data element
      14. 4.5.14 The time element
      15. 4.5.15 The code element
      16. 4.5.16 The var element
      17. 4.5.17 The samp element
      18. 4.5.18 The kbd element
      19. 4.5.19 The sub and sup elements
      20. 4.5.20 The i element
      21. 4.5.21 The b element
      22. 4.5.22 The u element
      23. 4.5.23 The mark element
      24. 4.5.24 The bdi element
      25. 4.5.25 The bdo element
      26. 4.5.26 The span element
      27. 4.5.27 The br element
      28. 4.5.28 The wbr element
      29. 4.5.29 Usage summary
    6. 4.6 Links
      1. 4.6.1 Introduction
      2. 4.6.2 Links created by a and area elements
      3. 4.6.3 API for hyperlink elements
      4. 4.6.4 Downloading resources
      5. 4.6.5 Hyperlink auditing
        1. 4.6.5.1 The `Ping-From` and `Ping-To` headers
      6. 4.6.6 Link types
        1. 4.6.6.1 Link type "alternate"
        2. 4.6.6.2 Link type "author"
        3. 4.6.6.3 Link type "bookmark"
        4. 4.6.6.4 Link type "canonical"
        5. 4.6.6.5 Link type "dns-prefetch"
        6. 4.6.6.6 Link type "expect"
        7. 4.6.6.7 Link type "external"
        8. 4.6.6.8 Link type "help"
        9. 4.6.6.9 Link type "icon"
        10. 4.6.6.10 Link type "license"
        11. 4.6.6.11 Link type "manifest"
        12. 4.6.6.12 Link type "modulepreload"
        13. 4.6.6.13 Link type "nofollow"
        14. 4.6.6.14 Link type "noopener"
        15. 4.6.6.15 Link type "noreferrer"
        16. 4.6.6.16 Link type "opener"
        17. 4.6.6.17 Link type "pingback"
        18. 4.6.6.18 Link type "preconnect"
        19. 4.6.6.19 Link type "prefetch"
        20. 4.6.6.20 Link type "preload"
        21. 4.6.6.21 Link type "privacy-policy"
        22. 4.6.6.22 Link type "search"
        23. 4.6.6.23 Link type "stylesheet"
        24. 4.6.6.24 Link type "tag"
        25. 4.6.6.25 Link Type "terms-of-service"
        26. 4.6.6.26 Sequential link types
          1. 4.6.6.26.1 Link type "next"
          2. 4.6.6.26.2 Link type "prev"
        27. 4.6.6.27 Other link types
    7. 4.7 Edits
      1. 4.7.1 The ins element
      2. 4.7.2 The del element
      3. 4.7.3 Attributes common to ins and del elements
      4. 4.7.4 Edits and paragraphs
      5. 4.7.5 Edits and lists
      6. 4.7.6 Edits and tables
    8. 4.8 Embedded content
      1. 4.8.1 The picture element
      2. 4.8.2 The source element
      3. 4.8.3 The img element
      4. 4.8.4 Images
        1. 4.8.4.1 Introduction
          1. 4.8.4.1.1 Adaptive images
        2. 4.8.4.2 Attributes common to source, img, and link elements
          1. 4.8.4.2.1 Srcset attributes
          2. 4.8.4.2.2 Sizes attributes
        3. 4.8.4.3 Requirements for providing text to act as an alternative for images
          1. 4.8.4.3.1 General guidelines
          2. 4.8.4.3.2 A link or button containing nothing but the image
          3. 4.8.4.3.3 A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations
          4. 4.8.4.3.4 A short phrase or label with an alternative graphical representation: icons, logos
          5. 4.8.4.3.5 Text that has been rendered to a graphic for typographical effect
          6. 4.8.4.3.6 A graphical representation of some of the surrounding text
          7. 4.8.4.3.7 Ancillary images
          8. 4.8.4.3.8 A purely decorative image that doesn't add any information
          9. 4.8.4.3.9 A group of images that form a single larger picture with no links
          10. 4.8.4.3.10 A group of images that form a single larger picture with links
          11. 4.8.4.3.11 A key part of the content
          12. 4.8.4.3.12 An image not intended for the user
          13. 4.8.4.3.13 An image in an email or private document intended for a specific person who is known to be able to view images
      5. 4.8.5 The iframe element
      6. 4.8.6 The embed element
      7. 4.8.7 The object element
      8. 4.8.8 The video element
      9. 4.8.9 The audio element
      10. 4.8.10 The track element
      11. 4.8.11 Media elements
        1. 4.8.11.1 Error codes
        2. 4.8.11.2 Location of the media resource
        3. 4.8.11.3 MIME types
        4. 4.8.11.4 Network states
        5. 4.8.11.5 Loading the media resource
        6. 4.8.11.6 Offsets into the media resource
        7. 4.8.11.7 Ready states
        8. 4.8.11.8 Playing the media resource
        9. 4.8.11.9 Seeking
        10. 4.8.11.10 Media resources with multiple media tracks
          1. 4.8.11.10.1 AudioTrackList and VideoTrackList objects
          2. 4.8.11.10.2 Selecting specific audio and video tracks declaratively
        11. 4.8.11.11 Timed text tracks
          1. 4.8.11.11.1 Text track model
          2. 4.8.11.11.2 Sourcing in-band text tracks