📄 rfc1866.txt
字号:
[MIME] specifies that a body of type `text/*' is a sequence of lines,
each terminated by CRLF, that is, octets 13, 10.
In practice, HTML documents are frequently represented and
transmitted using an end of line convention that depends on the
conventions of the source of the document; frequently, that
representation consists of CR only, LF only, or a CR LF sequence.
Hence the decoding of the octets will often result in a text entity
with some missing record start and record end characters.
Since there is no ambiguity, HTML user agents are encouraged to infer
the missing record start and end characters.
An HTML user agent should treat end of line in any of its variations
as a word space in all contexts except preformatted text. Within
preformatted text, an HTML user agent should treat any of the three
common representations of end-of-line as starting a new line.
5. Document Structure
An HTML document is a tree of elements, including a head and body,
headings, paragraphs, lists, etc. Form elements are discussed in 8,
"Forms".
Berners-Lee & Connolly Standards Track [Page 20]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
5.1. Document Element: HTML
The HTML document element consists of a head and a body, much like a
memo or a mail message. The head contains the title and optional
elements. The body is a text flow consisting of paragraphs, lists,
and other elements.
5.2. Head: HEAD
The head of an HTML document is an unordered collection of
information about the document. For example:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HEAD>
<TITLE>Introduction to HTML</TITLE>
</HEAD>
...
5.2.1. Title: TITLE
Every HTML document must contain a <TITLE> element.
The title should identify the contents of the document in a global
context. A short title, such as "Introduction" may be meaningless out
of context. A title such as "Introduction to HTML Elements" is more
appropriate.
NOTE - The length of a title is not limited; however, long titles
may be truncated in some applications. To minimize this
possibility, titles should be fewer than 64 characters.
A user agent may display the title of a document in a history list or
as a label for the window displaying the document. This differs from
headings (5.4, "Headings: H1 ... H6"), which are typically displayed
within the body text flow.
5.2.2. Base Address: BASE
The optional <BASE> element provides a base address for interpreting
relative URLs when the document is read out of context (see 7,
"Hyperlinks"). The value of the HREF attribute must be an absolute
URI.
5.2.3. Keyword Index: ISINDEX
The <ISINDEX> element indicates that the user agent should allow the
user to search an index by giving keywords. See 7.5, "Queries and
Indexes" for details.
Berners-Lee & Connolly Standards Track [Page 21]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
5.2.4. Link: LINK
The <LINK> element represents a hyperlink (see 7, "Hyperlinks"). Any
number of LINK elements may occur in the <HEAD> element of an HTML
document. It has the same attributes as the <A> element (see 5.7.3,
"Anchor: A").
The <LINK> element is typically used to indicate authorship, related
indexes and glossaries, older or more recent versions, document
hierarchy, associated resources such as style sheets, etc.
5.2.5. Associated Meta-information: META
The <META> element is an extensible container for use in identifying
specialized document meta-information. Meta-information has two main
functions:
* to provide a means to discover that the data set exists
and how it might be obtained or accessed; and
* to document the content, quality, and features of a data
set, indicating its fitness for use.
Each <META> element specifies a name/value pair. If multiple META
elements are provided with the same name, their combined contents--
concatenated as a comma-separated list--is the value associated with
that name.
NOTE - The <META> element should not be used where a
specific element, such as <TITLE>, would be more
appropriate. Rather than a <META> element with a URI as
the value of the CONTENT attribute, use a <LINK>
element.
HTTP servers may read the content of the document <HEAD> to generate
header fields corresponding to any elements defining a value for the
attribute HTTP-EQUIV.
NOTE - The method by which the server extracts document
meta-information is unspecified and not mandatory. The
<META> element only provides an extensible mechanism for
identifying and embedding document meta-information --
how it may be used is up to the individual server
implementation and the HTML user agent.
Berners-Lee & Connolly Standards Track [Page 22]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
Attributes of the META element:
HTTP-EQUIV
binds the element to an HTTP header field. An HTTP
server may use this information to process the document.
In particular, it may include a header field in the
responses to requests for this document: the header name
is taken from the HTTP-EQUIV attribute value, and the
header value is taken from the value of the CONTENT
attribute. HTTP header names are not case sensitive.
NAME
specifies the name of the name/value pair. If not
present, HTTP-EQUIV gives the name.
CONTENT
specifies the value of the name/value pair.
Examples
If the document contains:
<META HTTP-EQUIV="Expires"
CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
<meta http-equiv="Keywords" CONTENT="Fred">
<META HTTP-EQUIV="Reply-to"
content="fielding@ics.uci.edu (Roy Fielding)">
<Meta Http-equiv="Keywords" CONTENT="Barney">
then the server may include the following header fields:
Expires: Tue, 04 Dec 1993 21:29:02 GMT
Keywords: Fred, Barney
Reply-to: fielding@ics.uci.edu (Roy Fielding)
as part of the HTTP response to a `GET' or `HEAD' request for
that document.
An HTTP server must not use the <META> element to form an HTTP
response header unless the HTTP-EQUIV attribute is present.
An HTTP server may disregard any <META> elements that specify
information controlled by the HTTP server, for example `Server',
`Date', and `Last-modified'.
Berners-Lee & Connolly Standards Track [Page 23]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
5.2.6. Next Id: NEXTID
The <NEXTID> element is included for historical reasons only. HTML
documents should not contain <NEXTID> elements.
The <NEXTID> element gives a hint for the name to use for a new <A>
element when editing an HTML document. It should be distinct from all
NAME attribute values on <A> elements. For example:
<NEXTID N=Z27>
5.3. Body: BODY
The <BODY> element contains the text flow of the document, including
headings, paragraphs, lists, etc.
For example:
<BODY>
<h1>Important Stuff</h1>
<p>Explanation about important stuff...
</BODY>
5.4. Headings: H1 ... H6
The six heading elements, <H1> through <H6>, denote section headings.
Although the order and occurrence of headings is not constrained by
the HTML DTD, documents should not skip levels (for example, from H1
to H3), as converting such documents to other representations is
often problematic.
Example of use:
<H1>This is a heading</H1>
Here is some text
<H2>Second level heading</H2>
Here is some more text.
Typical renderings are:
H1
Bold, very-large font, centered. One or two blank lines
above and below.
H2
Bold, large font, flush-left. One or two blank lines
above and below.
Berners-Lee & Connolly Standards Track [Page 24]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
H3
Italic, large font, slightly indented from the left
margin. One or two blank lines above and below.
H4
Bold, normal font, indented more than H3. One blank line
above and below.
H5
Italic, normal font, indented as H4. One blank line
above.
H6
Bold, indented same as normal text, more than H5. One
blank line above.
5.5. Block Structuring Elements
Block structuring elements include paragraphs, lists, and block
quotes. They must not contain heading elements, but they may contain
phrase markup, and in some cases, they may be nested.
5.5.1. Paragraph: P
The <P> element indicates a paragraph. The exact indentation, leading
space, etc. of a paragraph is not specified and may be a function of
other tags, style sheets, etc.
Typically, paragraphs are surrounded by a vertical space of one line
or half a line. The first line in a paragraph is indented in some
cases.
Example of use:
<H1>This Heading Precedes the Paragraph</H1>
<P>This is the text of the first paragraph.
<P>This is the text of the second paragraph. Although you do not
need to start paragraphs on new lines, maintaining this
convention facilitates document maintenance.</P>
<P>This is the text of a third paragraph.</P>
5.5.2. Preformatted Text: PRE
The <PRE> element represents a character cell block of text and is
suitable for text that has been formatted for a monospaced font.
The <PRE> tag may be used with the optional WIDTH attribute. The
WIDTH attribute specifies the maximum number of characters for a line
Berners-Lee & Connolly Standards Track [Page 25]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
and allows the HTML user agent to select a suitable font and
indentation.
Within preformatted text:
* Line breaks within the text are rendered as a move to the
beginning of the next line.
NOTE - References to the "beginning of a new line"
do not imply that the renderer is forbidden from
using a constant left indent for rendering
preformatted text. The left indent may be
constrained by the width required.
* Anchor elements and phrase markup may be used.
NOTE - Constraints on the processing of <PRE>
content may limit or prevent the ability of the HTML
user agent to faithfully render phrase markup.
* Elements that define paragraph formatting (headings,
address, etc.) must not be used.
NOTE - Some historical documents contain <P> tags in
<PRE> elements. User agents are encouraged to treat
this as a line break. A <P> tag followed by a
newline character should produce only one line
break, not a line break plus a blank line.
* The horizontal tab character (code position 9 in the HTML
document character set) must be interpreted as the smallest
positive nonzero number of spaces which will leave the
number of characters so far on the line as a multiple of 8.
Documents should not contain tab characters, as they are not
supported consistently.
Example of use:
<PRE>
Line 1.
Line 2 is to the right of line 1. <a href="abc">abc</a>
Line 3 aligns with line 2. <a href="def">def</a>
</PRE>
Berners-Lee & Connolly Standards Track [Page 26]
RFC 1866 Hypertext Markup Language - 2.0 November 1995
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -