HTML 4.0 Specification

W3C Working Draft 17-Sep-1997

This version:
Latest version:
Previous version:


This specification defines the HyperText Markup Language (HTML), version 4.0, the publishing language of the World Wide Web. In addition to the text, multimedia, and hyperlink features of the previous versions of HTML, HTML 4.0 supports more multimedia options, scripting languages, style sheets, better printing facilities, and documents that are more accessible to users with disabilities. HTML 4.0 also takes great strides towards the internationalization of documents, with the goal of making the Web truly World Wide.

HTML 4.0 is an SGML application conforming to International Standard ISO 8879 -- Standard Generalized Markup Language [ISO8879]). As an SGML application, the syntax of conforming HTML 4.0 documents is defined by the combination of the SGML declaration and the document type definition (DTD). This specification defines the intended interpretation of HTML 4.0 elements and adds syntax constraints that may not be expressed by the DTD alone.

Status of this document

This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". This is work in progress and does not imply endorsement by, or the consensus of, either W3C or members of the HTML working group.

This document has been produced as part of the W3C HTML Activity, and is intended as a draft of a proposed recommendation for HTML.

HTML 4.0 replaces HTML 3.2, specified in http://www.w3.org/TR/REC-html32.



Please send detailed comments on this document to www-html-editor@w3.org. We cannot guarantee a personal response but we will try when it is appropriate. Public discussion on HTML features takes place on www-html@w3.org.

Table of Contents

  1. About the HTML 4.0 Specification
    1. How to read the specification
    2. How the specification is organized
    3. Acknowledgments
  2. Introduction to HTML 4.0
    1. A brief history of HTML
    2. HTML 4.0
      1. Internationalization
      2. Accessibility
      3. Tables
      4. Compound documents
      5. Style sheets
      6. Scripting
      7. Printing
    3. Designing documents with HTML 4.0
      1. Separate structure and presentation
      2. Consider universal accessibility to the Web
      3. Help user agents with incremental rendering
  3. A brief SGML tutorial
    1. HTML syntax
      1. Entities
      2. Elements
      3. Attributes
      4. HTML comments
      5. SGML features with limited support
    2. How to read the HTML DTD
      1. Block level and Inline elements
      2. DTD Comments
      3. Parameter entity definitions
      4. Element definitions
      5. Attribute definitions
  4. Definitions and Conventions
    1. Definitions
    2. Document conventions
      1. Elements and attributes
      2. Notes and examples
    3. SGML
  5. HTML and URLs - Locating resources on the Web
    1. Uniform Resource Locators (URLs)
      1. Fragment identifiers
      2. Relative URLs
      3. URLs in HTML
  6. HTML Document Character Set - Character sets, character encodings, and entities
    1. The Document Character Set
    2. Character entities
  7. Basic HTML data types - Character data, colors, and lengths
    1. URLs
    2. Character data
    3. Colors
      1. Notes on using colors
    4. Lengths and Pixels
  8. The global structure of an HTML document - The HEAD and BODY of a document
    1. HTML version information
    2. The HTML element
    3. The HEAD element
      1. Titles: the TITLE element and the title attribute
      2. Meta information
    4. The BODY element
      1. Element identifiers: the id and class attributes
      2. Grouping elements: the DIV and SPAN elements
      3. Headings: The H1, H2, H3, H4, H5, H6 elements
      4. The ADDRESS element
  9. Language information and text direction - International considerations for text
    1. Specifying the language of content: the lang attribute
      1. Inheritance of language codes
      2. Interpretation of language codes
    2. Specifying the direction of text: 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. Support for character directionality and joining
      6. The effect of style sheets on bidirectionality
      7. Undisplayable characters
  10. Text - Paragraphs, Lines, and Phrases
    1. White space
    2. Structured text
      1. Phrasal elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, 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. Visual rendering of paragraphs
      3. Controlling line breaks
      4. Hyphenation
      5. Preformatted text: The PRE element
    4. Marking document changes: The INS and DEL elements
      1. Date and time format
  11. Lists - Unordered, Ordered, and Definition Lists
    1. Unordered (UL) and ordered (OL) lists
      1. Lists formatted by visual user agents
    2. Definition lists: the DL, DT, and DD elements
    3. The DIR and MENU elements
  12. Tables
    1. Elements for constructing tables
      1. The TABLE element
      2. Table Captions: The CAPTION element
      3. Groups of rows: the THEAD, TFOOT, and TBODY elements
      4. Groups of columns: the COLGROUP and COL elements
      5. Table rows: The TR element
      6. Table cells: The TH and TD elements
    2. Table formatting by visual user agents
      1. Horizontal and vertical alignment
      2. Borders and rules
      3. Cell margins
    3. Some sample tables
      1. Sample 1
      2. Sample 2
  13. Links - Hypertext and Media-Independent Links
    1. Introduction to links and anchors
      1. Visiting a linked resource
      2. Other link relationships
      3. Specifying links and anchors
      4. Link titles
      5. Internationalization and links
    2. Resource retrieval: the A element
      1. Syntax of anchor names
      2. Mailto links
      3. Nested links
      4. Anchors with the id attribute
    3. Document relationships: the LINK element
      1. Reverse Links
      2. Link types
      3. Links and external style sheets
      4. Links and search engines
    4. Path information: the BASE element
  14. Objects, Images, and Applets
    1. Including an image: the IMG element
    2. Generic inclusion: the OBJECT element
      1. Rules for rendering objects
      2. Object initialization: the PARAM element
      3. URLs other than HTTP URLs
      4. Object declarations and instantiations
    3. Including an applet: the APPLET element
    4. Including HTML in another HTML document
    5. Image maps
      1. Client-side image maps
      2. Server-side image maps
    6. Visual presentation of images, objects, and applets
      1. Width and height
      2. White space around images and objects
      3. Borders
      4. Alignment
    7. How to specify alternate text
  15. Style Sheets - Controlling the presentation of an HTML document
    1. 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
      5. External style sheets
      6. Setting the default named style
      7. Media-dependent cascades
    2. Inheritance and cascading
    3. Hiding the Content of Style Elements from non-conforming User Agents
    4. Specifying style through HTTP headers
  16. 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
  17. Frames - Multi-view presentation of documents
    1. Layout of frames
      1. The FRAMESET element
      2. The FRAME element
    2. Specifying target frame information
      1. Setting the default target for links
      2. Target semantics
      3. Target names
    3. Alternate content
      1. The NOFRAMES element
    4. Inline frames: the IFRAME element
  18. Forms - User-input Forms: Text Fields, Buttons, Menus, and more
    1. The FORM element
    2. Controls
      1. The INPUT element
      2. The BUTTON element
      3. The SELECT and OPTION elements
      4. The TEXTAREA element
      5. The LABEL element
      6. The FIELDSET and LEGEND elements
    3. Giving focus to an element
      1. Tabbing navigation
      2. Access keys
    4. Disabled and read-only elements
      1. Disabled elements
      2. Read-only elements
    5. Form submission
      1. Processing form data
      2. Which control values are submitted
  19. Scripts - Animated Documents and Smart Forms
    1. Designing documents for user agents that support scripting
      1. The SCRIPT element
      2. Specifying the scripting language
      3. Syntax of script content
      4. Intrinsic events
      5. Dynamic modification of documents
    2. Designing documents for user agents that don't support scripting
      1. The NOSCRIPT element
      2. Commenting out scripts
  20. SGML reference information for HTML - Formal definition of HTML and validation
    1. Document Validation
    2. Sample SGML catalog
  21. SGML Declaration
    1. The Document Character Set
      1. Data transfer
    2. The SGML Declaration
  22. Document Type Definition
  23. Transitional Document Type Definition
  24. Frameset Document Type Definition
  25. Named character entities
    1. Named entities for ISO 8859-1 characters
      1. The list of characters
    2. Named entities for symbols, mathematical symbols, and Greek letters
      1. The list of characters
    3. Named entities for markup-significant and internationalization characters
      1. The list of characters
  1. Changes between HTML 3.2 and HTML 4.0
    1. Changes to elements
      1. New elements
      2. Deprecated elements
      3. Obsolete elements
    2. Changes to Tables
    3. Changes to Forms
  2. Performance, Implementation, and Design Notes
    1. Notes on helping search engines index your Web site
      1. Search robots
    2. Notes on tables
      1. Design rationale
      2. Recommended Layout Algorithms
    3. Notes on forms
      1. Incremental display
      2. Future projects
    4. Notes on scripting
      1. Reserved syntax for future script macros
    5. Notes on accessibility
      1. Generating alternate text