HTML Working Group T. Berners-Lee
Some text. *wow*
\-"Some text. "
This is a Heading
Some elements only have a start-tag without an end-tag. For
example, to create a line break, use the `
' tag. Additionally, the end tags of some other elements, such as Paragraph (`
Some text. *wow*An HTML user agent should use the SGML declaration that is given in 9.5, "SGML Declaration for HTML". According to its document character set, `*' refers to an asterisk character, `*'. The instance above is regarded as the following sequence of terminals: 1. start-tag: TITLE 2. data characters: ``Parsing Example'' 3. end-tag: TITLE 4. start-tag: P 5. data characters ``Some text. '' 6. start-tag: EM 7. data characters: ``*wow*'' 8. end-tag: EM 9. end-tag: P The start symbol of the DTD grammar is HTML, and the productions are given in the public text identified by `-//IETF//DTD HTML 2.0//EN' (9.1, "HTML DTD"). The terminals above parse as: HTML | \-HEAD | | Berners-Lee, Connolly [Page 10] INTERNET-DRAFT Hypertext Markup Language - 2.0 September 22, 1995 | \-TITLE | | | \-
| \-"Some text. " | \-EM | | | \- | | | \-"*wow*" | | | \- | \-Some of the elements are delimited explicitly by tags, while the boundaries of others are inferred. The element contains a element and a element. The contains
', `', and `' are equivalent, whereas `&' is different from `&'. In a start-tag, the element name must immediately follow the tag open delimiter `<'. 3.2.4. Attributes In a start-tag, white space and attributes are allowed between the element name and the closing delimiter. An attribute specification typically consists of an attribute name, an equal sign, and a value, though some attribute specifications may be just a name token. White space is allowed around the equal sign. The value of the attribute may be either: * A string literal, delimited by single quotes or double quotes and not containing any occurrences of the delimiting character. NOTE - Some historical implementations consider any occurrence of the `>' character to signal the end of a tag. For compatibility with such implementations, Berners-Lee, Connolly [Page 13] INTERNET-DRAFT Hypertext Markup Language - 2.0 September 22, 1995 when `>' appears in an attribute value, it should be represented with a numeric character reference. For example, `' should be written `' or `'. * A name token (a sequence of letters, digits, periods, or hyphens). Name tokens are not case sensitive. NOTE - Some historical implementations allow any character except space or `>' in a name token. In this example, is the element name, src is the attribute name, and `http://host/dir/file.gif' is the attribute value: A useful technique for computing an attribute value literal for a given string is to replace each quote and white space character by an entity reference or numeric character reference as follows: ENTITY NUMERIC CHARACTER REFERENCE CHAR REF CHARACTER DESCRIPTION --------- ---------- ----------- --------------------- HT Tab LF Line Feed CR Carriage Return SP Space " " " Quotation mark & & & Ampersand For example: The `NAMELEN' parameter in the SGML declaration (9.5, "SGML Declaration for HTML") limits the length of an attribute value to 1024 characters. Attributes such as ISMAP and COMPACT may be written using a minimized syntax (see 188.8.131.52 ``Omitted Attribute Name'' in [SGML]). The markup:
can be written using a minimized syntax:
NOTE - Some historical implementations only understand the minimized syntax. Berners-Lee, Connolly [Page 14] INTERNET-DRAFT Hypertext Markup Language - 2.0 September 22, 1995 3.2.5. Comments To include comments in an HTML document, use a comment declaration. A comment declaration consists of `'. Each comment starts with `--' and includes all text up to and including the next occurrence of `--'. In a comment declaration, white space is allowed after each comment, but not before the first comment. The entire comment declaration is ignored. NOTE - Some historical HTML implementations incorrectly consider any `>' character to be the termination of a comment. For example:
HTML Comment Example
3.3. HTML Public Text Identifiers To identify information as an HTML document conforming to this specification, each document must start with one of the following document type declarations. This document type declaration refers to the HTML DTD in 9.1, "HTML DTD". NOTE - If the body of a `text/html' message entity does not begin with a document type declaration, an HTML user agent should infer the above document type declaration. This document type declaration also refers to the HTML DTD which appears in 9.1, "HTML DTD". This document type declaration refers to the level 1 HTML DTD in 9.3, "Level 1 HTML DTD". Form elements must not occur in level 1 documents. Berners-Lee, Connolly [Page 15] INTERNET-DRAFT Hypertext Markup Language - 2.0 September 22, 1995 These two document type declarations refer to the HTML DTD in 9.2, "Strict HTML DTD" and 9.4, "Strict Level 1 HTML DTD". They refer to the more structurally rigid definition of HTML. HTML user agents may support other document types. In particular, they may support other formal public identifiers, or other document types altogether. They may support an internal declaration subset with supplemental entity, element, and other markup declarations. 3.4. Example HTML Document
This is a paragraph in the example HTML file. Keep in mind that the title does not appear in the document text, but that the header (defined by H1) does.
- First item in an ordered list.
- Second item in an ordered list.
- Note that lists can be nested;
- Whitespace may be used to assist in reading the HTML source.
- Third item in an ordered list.
This is an additional paragraph. Technically, end tags are not required for paragraphs, although they are allowed. You can include character highlighting in a paragraph. This sentence of the paragraph is emphasized. Note that the </P> end tag has been omitted.
Be sure to read these bold instructions. 4. HTML as an Internet Media Type An HTML user agent allows users to interact with resources which have HTML representations. At a minimum, it must allow users to examine and navigate the content of HTML level 1 documents. HTML user agents should be able to preserve all formatting distinctions represented in an HTML document, and be able to Berners-Lee, Connolly [Page 16] INTERNET-DRAFT Hypertext Markup Language - 2.0 September 22, 1995 simultaneously present resources referred to by IMG elements (they may ignore some formatting distinctions or IMG resources at the request of the user). Level 2 HTML user agents should support form entry and submission. 4.1. text/html media type This specification defines the Internet Media Type[IMEDIA] (formerly referred to as the Content Type[MIME]) called `text/html'. The following is to be registered with [IANA]. Media Type name text Media subtype name html Required parameters none Optional parameters level, charset Encoding considerations any encoding is allowed Security considerations see 10, "Security Considerations" The optional parameters are defined as follows: Level The level parameter specifies the feature set used in the document. The level is an integer number, implying that any features of same or lower level may be present in the document. Level 1 is all features defined in this specification except those that require the