📄 rfc1866.txt
字号:
RFC 1866 Hypertext Markup Language - 2.0 November 1995
with techniques for reducing HTML to 7 bit ASCII for
transport, they are deprecated in this version of HTML.
See 5.5.2.1, "Example and Listing: XMP, LISTING".
3.2.2. Tags
Tags delimit elements such as headings, paragraphs, lists, character
highlighting, and links. Most HTML elements are identified in a
document as a start-tag, which gives the element name and attributes,
followed by the content, followed by the end tag. Start-tags are
delimited by `<' and `>'; end tags are delimited by `</' and `>'. An
example is:
<H1>This is a Heading</H1>
Some elements only have a start-tag without an end-tag. For example,
to create a line break, use the `<BR>' tag. Additionally, the end
tags of some other elements, such as Paragraph (`</P>'), List Item
(`</LI>'), Definition Term (`</DT>'), and Definition Description
(`</DD>') elements, may be omitted.
The content of an element is a sequence of data character strings and
nested elements. Some elements, such as anchors, cannot be nested.
Anchors and character highlighting may be put inside other
constructs. See the HTML DTD, 9.1, "HTML DTD" for full details.
NOTE - The SGML declaration for HTML specifies SHORTTAG YES, which
means that there are other valid syntaxes for tags, such as NET
tags, `<EM/.../'; empty start tags, `<>'; and empty end-tags,
`</>'. Until support for these idioms is widely deployed, their
use is strongly discouraged.
3.2.3. Names
A name consists of a letter followed by letters, digits, periods, or
hyphens. The length of a name is limited to 72 characters by the
`NAMELEN' parameter in the SGML declaration for HTML, 9.5, "SGML
Declaration for HTML". Element and attribute names are not case
sensitive, but entity names are. For example, `<BLOCKQUOTE>',
`<BlockQuote>', and `<blockquote>' are equivalent, whereas `&' is
different from `&'.
In a start-tag, the element name must immediately follow the tag open
delimiter `<'.
Berners-Lee & Connolly Standards Track [Page 14]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
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,
when `>' appears in an attribute value, it should be
represented with a numeric character reference. For
example, `<IMG SRC="eq1.jpg" alt="a>b">' should be
written `<IMG SRC="eq1.jpg" alt="a>b">' or `<IMG
SRC="eq1.jpg" alt="a>b">'.
* 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, <img> is the element name, src is the attribute
name, and `http://host/dir/file.gif' is the attribute value:
<img src='http://host/dir/file.gif'>
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
Berners-Lee & Connolly Standards Track [Page 15]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
For example:
<IMG SRC="image.jpg" alt="First "real" 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 7.9.1.2 "Omitted Attribute Name" in [SGML]). The markup:
<UL COMPACT="compact">
can be written using a minimized syntax:
<UL COMPACT>
NOTE - Some historical implementations only understand the minimized
syntax.
3.2.5. Comments
To include comments in an HTML document, use a comment declaration. A
comment declaration consists of `<!' followed by zero or more
comments followed by `>'. 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:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HEAD>
<TITLE>HTML Comment Example</TITLE>
<!-- Id: html-sgml.sgm,v 1.5 1995/05/26 21:29:50 connolly Exp -->
<!-- another -- -- comment -->
<!>
</HEAD>
<BODY>
<p> <!- not a comment, just regular old data characters ->
Berners-Lee & Connolly Standards Track [Page 16]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
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.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
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.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN">
This document type declaration also refers to the HTML DTD which
appears in 9.1, "HTML DTD".
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Level 1//EN">
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.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<!-- Here's a good place to put a comment. -->
<HEAD>
<TITLE>Structural Example</TITLE>
</HEAD><BODY>
<H1>First Header</H1>
<P>This is a paragraph in the example HTML file. Keep in mind
Berners-Lee & Connolly Standards Track [Page 17]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
that the title does not appear in the document text, but that
the header (defined by H1) does.</P>
<OL>
<LI>First item in an ordered list.
<LI>Second item in an ordered list.
<UL COMPACT>
<LI> Note that lists can be nested;
<LI> Whitespace may be used to assist in reading the
HTML source.
</UL>
<LI>Third item in an ordered list.
</OL>
<P>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. <EM>This sentence
of the paragraph is emphasized.</EM> Note that the </P>
end tag has been omitted.
<P>
<IMG SRC ="triangle.xbm" alt="Warning: ">
Be sure to read these <b>bold instructions</b>.
</BODY></HTML>
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 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
Berners-Lee & Connolly Standards Track [Page 18]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
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 <FORM>
element. Level 2 includes form processing. Level 2 is
the default.
Charset
The charset parameter (as defined in section 7.1.1 of
RFC 1521[MIME]) may be given to specify the character
encoding scheme used to represent the HTML document as a
sequence of octets. The default value is outside the
scope of this specification; but for example, the
default is `US-ASCII' in the context of MIME mail, and
`ISO-8859-1' in the context of HTTP [HTTP].
4.2. HTML Document Representation
A message entity with a content type of `text/html' represents an
HTML document, consisting of a single text entity. The `charset'
parameter (whether implicit or explicit) identifies a character
encoding scheme. The text entity consists of the characters
determined by this character encoding scheme and the octets of the
body of the message entity.
4.2.1. Undeclared Markup Error Handling
To facilitate experimentation and interoperability between
implementations of various versions of HTML, the installed base of
HTML user agents supports a superset of the HTML 2.0 language by
reducing it to HTML 2.0: markup in the form of a start-tag or end-
tag, whose generic identifier is not declared is mapped to nothing
during tokenization. Undeclared attributes are treated similarly. The
entire attribute specification of an unknown attribute (i.e., the
unknown attribute and its value, if any) should be ignored. On the
Berners-Lee & Connolly Standards Track [Page 19]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
other hand, references to undeclared entities should be treated as
data characters.
For example:
<div class=chapter><h1>foo</h1><p>...</div>
=> <H1>,"foo",</H1>,<P>,"..."
xxx <P ID=z23> yyy
=> "xxx ",<P>," yyy
Let α & β be finite sets.
=> "Let α & β be finite sets."
Support for notifying the user of such errors is encouraged.
Information providers are warned that this convention is not binding:
unspecified behavior may result, as such markup does not conform to
this specification.
4.2.2. Conventional Representation of Newlines
SGML specifies that a text entity is a sequence of records, each
beginning with a record start character and ending with a record end
character (code positions 10 and 13 respectively) (section 7.6.1,
"Record Boundaries" in [SGML]).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -