W3C

HTML 4.01 Specification

W3C Recommendation 24 December 1999
superseded 27 March 2018

This version:
https://www.w3.org/TR/2018/SPSD-html401-20180327/
Latest version of HTML 4.01:
http://www.w3.org/TR/html401
Latest version of HTML 4:
http://www.w3.org/TR/html4
Latest version of HTML:
https://www.w3.org/TR/html/
Previous version of HTML 4.01:
http://www.w3.org/TR/1999/REC-html401-19991224
Previous HTML 4 Recommendation:
http://www.w3.org/TR/1998/REC-html40-19980424
Editors:
Dave Raggett <[email protected]>
Arnaud Le Hors, W3C
Ian Jacobs, W3C

Abstract

This specification defines the HyperText Markup Language (HTML), the publishing language of the World Wide Web. This specification defines HTML 4.01, which is a subversion of HTML 4. In addition to the text, multimedia, and hyperlink features of the previous versions of HTML (HTML 3.2 [HTML32] and HTML 2.0 [RFC1866]), HTML 4 supports more multimedia options, scripting languages, style sheets, better printing facilities, and documents that are more accessible to users with disabilities. HTML 4 also takes great strides towards the internationalization of documents, with the goal of making the Web truly World Wide.

HTML 4 is an SGML application conforming to International Standard ISO 8879 -- Standard Generalized Markup Language [ISO8879].

Status of this document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.

This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation.

This specification is a Superseded Recommendation. A newer specification exists that is recommended for new adoption in place of this specification. New implementations should follow the latest version of the HTML specification.

A list of current W3C Recommendations and other technical documents can be found at https://www.w3.org/TR/.

Available languages

The English version of this specification is the only normative version. However, for translations of this document, see http://www.w3.org/MarkUp/html4-updates/translations.

Errata

The list of known errors in this specification is available at:
http://www.w3.org/MarkUp/html4-updates/errata

Quick Table of Contents

  1. About the HTML 4 Specification
  2. Introduction to HTML 4
  3. On SGML and HTML
  4. Conformance: requirements and recommendations
  5. HTML Document Representation - Character sets, character encodings, and entities
  6. Basic HTML data types - Character data, colors, lengths, URIs, content types, etc.
  7. The global structure of an HTML document - The HEAD and BODY of a document
  8. Language information and text direction - International considerations for text
  9. Text - Paragraphs, Lines, and Phrases
  10. Lists - Unordered, Ordered, and Definition Lists
  11. Tables
  12. Links - Hypertext and Media-Independent Links
  13. Objects, Images, and Applets
  14. Style Sheets - Adding style to HTML documents
  15. Alignment, font styles, and horizontal rules
  16. Frames - Multi-view presentation of documents
  17. Forms - User-input Forms: Text Fields, Buttons, Menus, and more
  18. Scripts - Animated Documents and Smart Forms
  19. SGML reference information for HTML - Formal definition of HTML and validation
  20. SGML Declaration of HTML 4
  21. Document Type Definition
  22. Transitional Document Type Definition
  23. Frameset Document Type Definition
  24. Character entity references in HTML 4
  1. Changes
  2. Performance, Implementation, and Design Notes

Full Table of Contents

  1. About the HTML 4 Specification
    1. How the specification is organized
    2. Document conventions
      1. Elements and attributes
      2. Notes and examples
    3. Acknowledgments
      1. Acknowledgments for the current revision
    4. Copyright Notice
  2. Introduction to HTML 4
    1. What is the World Wide Web?
      1. Introduction to URIs
      2. Fragment identifiers
      3. Relative URIs
    2. What is HTML?
      1. A brief history of HTML
    3. HTML 4
      1. Internationalization
      2. Accessibility
      3. Tables
      4. Compound documents
      5. Style sheets
      6. Scripting
      7. Printing
    4. Authoring documents with HTML 4
      1. Separate structure and presentation
      2. Consider universal accessibility to the Web
      3. Help user agents with incremental rendering
  3. On SGML and HTML
    1. Introduction to SGML
    2. SGML constructs used in HTML
      1. Elements
      2. Attributes
      3. Character references
      4. Comments
    3. How to read the HTML DTD
      1. DTD Comments
      2. Parameter entity definitions
      3. Element declarations
      4. Attribute declarations
  4. Conformance: requirements and recommendations
    1. Definitions
    2. SGML
    3. The text/html content type
  5. HTML Document Representation - Character sets, character encodings, and entities
    1. The Document Character Set
    2. Character encodings
      1. Choosing an encoding
      2. Specifying the character encoding
    3. Character references
      1. Numeric character references
      2. Character entity references
    4. Undisplayable characters
  6. Basic HTML data types - Character data, colors, lengths, URIs, content types, etc.
    1. Case information
    2. SGML basic types
    3. Text strings
    4. URIs
    5. Colors
      1. Notes on using colors
    6. Lengths
    7. Content types (MIME types)
    8. Language codes
    9. Character encodings
    10. Single characters
    11. Dates and times
    12. Link types
    13. Media descriptors
    14. Script data
    15. Style sheet data
    16. Frame target names
  7. The global structure of an HTML document - The HEAD and BODY of a document
    1. Introduction to the structure of an HTML document
    2. HTML version information
    3. The HTML element
    4. The document head
      1. The HEAD element
      2. The TITLE element
      3. The title attribute
      4. Meta data
    5. The document body
      1. The BODY element
      2. Element identifiers: the id and class attributes
      3. Block-level and inline elements
      4. Grouping elements: the DIV and SPAN elements
      5. Headings: The H1, H2, H3, H4, H5, H6 elements
      6. The ADDRESS element
  8. Language information and text direction - International considerations for text
    1. Specifying the language of content: the lang attribute
      1. Language codes
      2. Inheritance of language codes
      3. Interpretation of language codes
    2. Specifying the direction of text and tables: the dir attribute
      1. Introduction to the bidirectional algorithm
      2. Inheritance of text direction information
      3. Setting the direction of embedded text
      4. Overriding the bidirectional algorithm: the BDO element
      5. Character references for directionality and joining control
      6. The effect of style sheets on bidirectionality
  9. Text - Paragraphs, Lines, and Phrases
    1. White space
    2. Structured text
      1. Phrase elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM
      2. Quotations: The BLOCKQUOTE and Q elements
      3. Subscripts and superscripts: the SUB and SUP elements
    3. Lines and Paragraphs
      1. Paragraphs: the P element
      2. Controlling line breaks
      3. Hyphenation
      4. Preformatted text: The PRE element
      5. Visual rendering of paragraphs
    4. Marking document changes: The INS and DEL elements
  10. Lists - Unordered, Ordered, and Definition Lists
    1. Introduction to lists
    2. Unordered lists (UL), ordered lists (OL), and list items (LI)
    3. Definition lists: the DL, DT, and DD elements
      1. Visual rendering of lists
    4. The DIR and MENU elements
  11. Tables
    1. Introduction to tables
    2. Elements for constructing tables
      1. The TABLE element
      2. Table Captions: The CAPTION element
      3. Row groups: the THEAD, TFOOT, and TBODY elements
      4. Column groups: the COLGROUP and COL elements
      5. Table rows: The TR element
      6. Table cells: The TH and TD elements
    3. Table formatting by visual user agents
      1. Borders and rules
      2. Horizontal and vertical alignment
      3. Cell margins
    4. Table rendering by non-visual user agents
      1. Associating header information with data cells
      2. Categorizing cells
      3. Algorithm to find heading information
    5. Sample table
  12. Links - Hypertext and Media-Independent Links
    1. Introduction to links and anchors
      1. Visiting a linked resource
      2. Other link relationships
      3. Specifying anchors and links
      4. Link titles
      5. Internationalization and links
    2. The A element
      1. Syntax of anchor names
      2. Nested links are illegal
      3. Anchors with the id attribute
      4. Unavailable and unidentifiable resources
    3. Document relationships: the LINK element
      1. Forward and reverse links
      2. Links and external style sheets
      3. Links and search engines
    4. Path information: the BASE element
      1. Resolving relative URIs
  13. Objects, Images, and Applets
    1. Introduction to objects, images, and applets
    2. Including an image: the IMG element
    3. Generic inclusion: the OBJECT element
      1. Rules for rendering objects
      2. Object initialization: the PARAM element
      3. Global naming schemes for objects
      4. Object declarations and instantiations
    4. Including an applet: the APPLET element
    5. Notes on embedded documents
    6. Image maps
      1. Client-side image maps: the MAP and AREA elements
      2. Server-side image maps
    7. Visual presentation of images, objects, and applets
      1. Width and height
      2. White space around images and objects
      3. Borders
      4. Alignment
    8. How to specify alternate text
  14. Style Sheets - Adding style to HTML documents
    1. Introduction to style sheets
    2. Adding style to HTML
      1. Setting the default style sheet language
      2. Inline style information
      3. Header style information: the STYLE element
      4. Media types
    3. External style sheets
      1. Preferred and alternate style sheets
      2. Specifying external style sheets
    4. Cascading style sheets
      1. Media-dependent cascades
      2. Inheritance and cascading
    5. Hiding style data from user agents
    6. Linking to style sheets with HTTP headers
  15. Alignment, font styles, and horizontal rules
    1. Formatting
      1. Background color
      2. Alignment
      3. Floating objects
    2. Fonts
      1. Font style elements: the TT, I, B, BIG, SMALL, STRIKE, S, and U elements
      2. Font modifier elements: FONT and BASEFONT
    3. Rules: the HR element
  16. Frames - Multi-view presentation of documents
    1. Introduction to frames
    2. Layout of frames
      1. The FRAMESET element
      2. The FRAME element
    3. Specifying target frame information
      1. Setting the default target for links
      2. Target semantics
    4. Alternate content
      1. The NOFRAMES element
      2. Long descriptions of frames
    5. Inline frames: the IFRAME element
  17. Forms - User-input Forms: Text Fields, Buttons, Menus, and more
    1. Introduction to forms
    2. Controls
      1. Control types
    3. The FORM element
    4. The INPUT element
      1. Control types created with INPUT
      2. Examples of forms containing INPUT controls
    5. The BUTTON element
    6. The SELECT, OPTGROUP, and OPTION elements
      1. Pre-selected options
    7. The TEXTAREA element
    8. The ISINDEX element
    9. Labels
      1. The LABEL element
    10. Adding structure to forms: the FIELDSET and LEGEND elements
    11. Giving focus to an element
      1. Tabbing navigation
      2. Access keys
    12. Disabled and read-only controls
      1. Disabled controls
      2. Read-only controls
    13. Form submission
      1. Form submission method
      2. Successful controls
      3. Processing form data
      4. Form content types
  18. Scripts - Animated Documents and Smart Forms
    1. Introduction to scripts
    2. Designing documents for user agents that support scripting
      1. The SCRIPT element
      2. Specifying the scripting language
      3. Intrinsic events
      4. Dynamic modification of documents
    3. Designing documents for user agents that don't support scripting
      1. The NOSCRIPT element
      2. Hiding script data from user agents
  19. SGML reference information for HTML - Formal definition of HTML and validation
    1. Document Validation
    2. Sample SGML catalog
  20. SGML Declaration of HTML 4
    1. SGML Declaration
  21. Document Type Definition
  22. Transitional Document Type Definition
  23. Frameset Document Type Definition
  24. Character entity references in HTML 4
    1. Introduction to character entity references
    2. Character entity references for ISO 8859-1 characters
      1. The list of characters
    3. Character entity references for symbols, mathematical symbols, and Greek letters
      1. The list of characters
    4. Character entity references for markup-significant and internationalization characters
      1. The list of characters
  1. Changes
    1. Changes between 24 April 1998 HTML 4.0 and 24 December 1999 HTML 4.01 versions
      1. Changes to the specification
      2. Errors that were corrected
      3. Minor typographical errors that were corrected
      4. Clarifications
      5. Known Browser problems
    2. Changes between 18 December 1997 and 24 April 1998 versions
      1. Errors that were corrected
      2. Minor typographical errors that were corrected
    3. Changes between HTML 3.2 and HTML 4.0 (18 December 1997)
      1. Changes to elements
      2. Changes to attributes
      3. Changes for accessibility
      4. Changes for meta data
      5. Changes for text
      6. Changes for links
      7. Changes for tables
      8. Changes for images, objects, and image maps
      9. Changes for forms
      10. Changes for style sheets
      11. Changes for frames
      12. Changes for scripting
      13. Changes for internationalization
  2. Performance, Implementation, and Design Notes
    1. Notes on invalid documents
    2. Special characters in URI attribute values
      1. Non-ASCII characters in URI attribute values
      2. Ampersands in URI attribute values
    3. SGML implementation notes
      1. Line breaks
      2. Specifying non-HTML data
      3. SGML features with limited support
      4. Boolean attributes
      5. Marked Sections
      6. Processing Instructions
      7. Shorthand markup
    4. Notes on helping search engines index your Web site
      1. Search robots
    5. Notes on tables
      1. Design rationale
      2. Recommended Layout Algorithms
    6. Notes on forms
      1. Incremental display
      2. Future projects
    7. Notes on scripting
      1. Reserved syntax for future script macros
    8. Notes on frames
    9. Notes on accessibility
    10. Notes on security
      1. Security issues for forms