7 Global structure of the document in HTML format

7.1 Introduction to the structure of an HTML document

The document in HTML 4.0 format consists of three parts:

  1. A line containing information about the version of HTML ,
  2. Header section (defined by the HEAD element),
  3. The body, which includes the actual contents of the document. The body can be entered by a BODY element or a FRAMESET element.

Before each element or after each element there can be an empty space (spaces, newlines, tabs and comments). Sections 2 and 3 should be separated by an HTML element.

Here is an example of a simple HTML document:

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
  "Http://www.w3.org/TR/REC-html40/strict.dtd">
 <HTML>
  <HEAD>
  <TITLE> My first HTML document </ TITLE>
  </ HEAD>
  <BODY>
  <P> Hello everyone!
  </ BODY>
 </ HTML>

7.2 Information about the HTML version

The HTML version used in the HTML document must be declared in the HTML document. A document type declaration specifies the document type definition (DTD) used in this document (see [ISO8879] ).

HTML 4.0 defines three DTDs, so authors must include one of the following type declarations in their documents. The difference between DTDs lies in the elements they support.

  • HTML 4.0 Strict DTD (strict definition) includes all elements and attributes that are not undesirable and are not used in documents with frames. For documents using this DTD, use such a document type declaration:
     <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
      "Http://www.w3.org/TR/REC-html40/strict.dtd">
    
  • HTML 4.0 Transitional DTD includes everything that is included in a strict DTD, as well as unwanted elements and attributes (most of which relate to the visual representation). For documents using this DTD, use such a document type declaration:
     <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 Transitional // EN"
      "Http://www.w3.org/TR/REC-html40/loose.dtd">
    
  • HTML 4.0 Frameset DTD (definition for frames) includes everything that is included in the transient DTD, as well as frames. For documents that use this DTD, use the following declaration of type:
     <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 Frameset // EN"
      "Http://www.w3.org/TR/REC-html40/frameset.dtd">
    

The URI in each document type declaration allows the user agents to load the DTD and all the necessary entity sets . The following URIs point to DTDs and combinationsets for HTML 4.0 supported by W3C:

The connection between common identifiers and files can be specified using a catalog file, followed by the format recommended by the Open SGML consortium (see [SGMLOPEN] ). An exemplary catalog file for HTML 4.0 is included at the beginning of the section on SGML reference information for HTML. The last two letters of the declaration indicate the DTD language. For HTML, this is always English ("EN").

7.3 The HTML element

  <! ENTITY% html.content "HEAD, BODY">
 <! ELEMENT HTML OO ( % html.content; ) - the root element of the document ->
 <! ATTLIST HTML
  % I18n;
  - lang , dir -
  >

Start tag: optional , End tag: optional

Attribute definitions

Version = cdata [CN]
Undesirable. The value of this attribute indicates the version of the HTML DTD to which this document is subject. This attribute is undesirable because it is redundant when there is version information specified in the document type declaration.

Attributes defined elsewhere

After the document type is declared, the rest of the HTML document is contained in the HTML element. Thus, a typical HTML document has this structure:

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
 "Http://www.w3.org/TR/REC-html40/strict.dtd">
 <HTML>
 ... Here goes the headline, body, etc ...

 </ HTML>

7.4 Title of the document

7.4.1 The HEAD Element

  <! - % head.misc;
  , Previously defined as "SCRIPT | STYLE | META | LINK | OBJECT" ->
 <! ENTITY% head.content "TITLE & BASE?">
 <! ELEMENT HEAD OO ( % head.content; ) + ( % head.misc; ) - document header ->
 <! ATTLIST HEAD
  % I18n;
  - lang , dir -
  Profile % URI;
  #IMPLIED - metainformation directory -
  >

Start tag: optional , End tag: optional

Attribute definitions

Profile = uri [CT]
This attribute specifies the location of one or more metadata profiles separated by spaces. To expand in the future, user agents must assume that the value is a list, although only the first URI is considered meaningful in this specification. Profiles are discussed below in the section on metadata .

Attributes defined elsewhere

The HEAD element contains information about the current document, such as a title, keywords that can be used by search engines, and other data that is not considered to be document content. User agents do not normally use elements from the HEAD section when generating items. However, they can provide users with information from the HEAD section using their own mechanisms.

7.4.2 The TITLE element

  <! - The TITLE element is not considered part of the text.
  It should be displayed, for example, as the title of the page
  Or window.  There must be exactly one title in the document.
  ->
 <! ELEMENT TITLE - - (#PCDATA) - ( % head.misc; ) - document header ->
 <! ATTLIST TITLE % i18n >

Start tag: required , End tag: required

Attributes defined elsewhere

Each HTML document must have a TITLE element in the HEAD section.

Authors should use the TITLE element to identify the content of the document. Since users often access documents outside the context, authors should provide headers in a broad context. Thus, instead of headings of the "Introduction" type, which do not say anything about the context, authors should use headings such as "Introduction to Medieval Beekeeping."

For reasons of availability, user agents should always make the contents of the TITLE element available to users (including TITLE elements in frames). The mechanism of this depends on the user agent (for example, in the form of a header or spoken).

Headings can include character combinations (for characters with accent marks, special characters, etc.), but can not contain other markups. Here is a sample document header:

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
  "Http://www.w3.org/TR/REC-html40/strict.dtd">
 <HTML>
 <HEAD>
 <TITLE> Population dynamics study </ TITLE>
 ... other header elements ... </ HEAD>
 <BODY>
 ... the body of the document ...

 </ BODY>
 </ HTML>

7.4.3 The title attribute

Attribute definitions

Title = text [CS]
This attribute provides information about the item for which it is installed.

Unlike the TITLE element, which provides information about the whole document and can be present in the text only once, the title attribute can accompany any number of elements. You can find out whether this element supports this attribute in the definition of an element.

Values ​​of the title attribute can be used by user agents in generating images in different ways. For example, visual browsers often display the title as a hint (a short message that appears if you point to an object). User's audio agents can speak header information. For example, setting this attribute for a link allows user agents (visual and non-visual) to inform users about the nature of the associated resource:

  ... text ... Here is a photo
 <A href="http://someplace.com/neatstuff.gif" title="Me scuba diving">
  How I dived last year
 </A>
 ... more text ...

The title attribute plays an additional role when used with a LINK element to assign an external style sheet. For more information, see the section on links and style sheets .

Note. To improve the quality of speech synthesis in the case of poor processing by standard mechanisms, future versions of HTML may include an attribute for coding phonemic information.

7.4.4 Metadata

At the time of writing this specification, work was carried out to enable authors to specify more machine-readable information about HTML documents and other network resources. For W3C metadata, the Resource Description Language has been developed (see [RDF] ).

HTML allows authors to specify metadata - information about a document instead of document content - in a variety of ways.

For example, to specify the author of a document, you can use the META element as follows:

 <META name = "Author" content = "Dave Reggett">

The META element specifies a property (here "Author") and assigns a value to it (here, "Dave Reggett").

This specification does not define a set of valid metadata properties. The property value and the set of valid values ​​for this property must be defined in a relative dictionary called a profile . For example, a profile designed to assist in indexing documents for search engines can define properties such as "author", "copyright", "keywords", etc.

Specifying metadata  

In general, the task of metadata consists of two steps:

  1. Declare a property and its values. This can be done in two ways:
    1. From the document using the META element.
    2. Not from the document by using a link to the metadata via the LINK element (see section on reference types ).
  2. Referring to the profile in which the properties and their permissible values ​​are determined. To assign a profile, use the profile attribute of the HEAD element.

Remember that since the profile is defined for the HEAD element, this profile applies to all META and LINK elements in the document header.

User agents do not need to support metadata mechanisms. This specification does not define the interpretation of metadata.

The META element  

  <! ELEMENT META - O EMPTY - general metainformation ->
 <! ATTLIST META
  % I18n;
  - lang , dir , for use with content -
  Http-equiv NAME #IMPLIED - the name of the HTTP response header -
  Name NAME #IMPLIED - metainformation name -
  Content CDATA #REQUIRED - related information -
  Scheme CDATA #IMPLIED - select the content form -
  >

Start tag: required , End tag: not allowed

Attribute definitions

For the following attributes, valid values ​​and their interpretation depend on the profile :

Name = name [CS]
This attribute specifies the name of the property. This specification does not list the valid values ​​for this attribute.
Content = cdata [cs]
This attribute determines the value of the property. This specification does not list the valid values ​​for this attribute.
Scheme = cdata [CS]
This attribute gives the name of the schema used to interpret the value of the property (for more information, see the section on profiles ).
Http-equiv = name [CI]
This attribute can be used instead of the name attribute. HTTP servers use this attribute to collect information for HTTP response message headers.

Attributes defined elsewhere

The META element can be used to identify document properties (for example, author, expiration date, keyword list, etc.) and assigning values ​​to them. This specification does not define a normative set of values.

Each META element sets a property / value pair. The name attribute specifies properties, and the content attribute value.

For example, the following declaration sets the value of the Author property:

  <META name = "Author" content = "Dave Reggett">

The lang attribute can be used with the META element to specify the language for the value of the content attribute. This allows speech synthesizers to use pronunciation rules for different languages.

In this example, the author's name is declared in French:

 <META name = "Author" lang = "fr" content = "Arnaud Le Hors">

Note. The META element is a common mechanism for specifying metadata. However, some elements and attributes of HTML already process some parts of metadata and can be used by authors instead of META elements to specify these parts: TITLE , ADDRESS , INS and DEL elements, title attribute and cite attribute.

Note. If a property specified by the META element accepts a URI value, some authors prefer to specify metadata using the LINK element. Thus, the following announcement:

  <META name = "DC.identifier"
  Content = "ftp://ds.internic.net/rfc/rfc1866.txt">

Can also be written as follows:

  <LINK rel = "DC.identifier"
  Type = "text / plain"
  Href = "ftp://ds.internic.net/rfc/rfc1866.txt">
META and HTTP headers

The http-equiv attribute can be used instead of the name attribute; It is especially important if documents are downloaded using the HyperText Transfer Protocol (HTTP). HTTP servers can use the property name specified in the http-equiv attribute to create a header in the HTTP response in the [RFC822] style. For more information about valid HTTP headers, see the HTTP specification ( [RFC2068] ).

In the following example, the META declaration:

 <META http-equiv = "Expires" content = "Tue, 20 Aug 1996 14:25:27 GMT">

Will return the following HTTP header:

  Expires: Tue, Aug 20, 1996 14:25:27 GMT 

This can be used by the cache to determine when to upload a new copy of the associated document.

Some user agents support the use of the META element to update the current page after a specified number of seconds, with the possibility of replacing it with another URI.

 <META http-equiv = "refresh" content = "3, http: //www.acme.com/intro.shtml">

Content is a number indicating a delay in seconds followed by a URI that needs to be downloaded after this time. This mechanism is widely used to create short-term screensavers. However, since some user agents do not support this mechanism, authors should include a splash screen in the next page (so that they can "hang" on the screen saver).

META and search engines

The main way to use the META element is to specify keywords that search engines can use to improve search results. If the document information is presented in several META elements depending on the language, the search engines can filter the lang attribute and display search results using the user-selected language. For example,

 <- For speakers of American English ->
 <META name = "keywords" lang = "en-us" 
  Content = "vacation, Greece, sunshine">
 <- For English speakers ->
 <META name = "keywords" lang = "en" 
  Content = "holiday, Greece, sunshine">
 <- for Russian-speaking users ->
 <META name = "keywords" lang = "fr" 
  Content = "vacation, Greece, the sun">

The effectiveness of the search engines can also be increased by using the the LINK element to specify references to translations of the document into other languages, links to versions of the document for other media (for example, PDF), and, if the document is part of the set, links to the corresponding starting point for viewing the set .

For more information, see How to Help Search Engines Index Your Web Server .

META and PICS
Platform for Internet Content Selection ( PICS, specified in [PICS] ) is an infrastructure for linking metadata (metadata) to Internet content. Created to help parents and teachers in managing children's access to the Internet, it also simplifies other use of labels, including code signature management, privacy and intellectual property rights.

This example illustrates the use of the META declaration to include the PICS 1.1 label:

  <HEAD>
  <META http-equiv = "PICS-Label" content = '
  (PICS-1.1 "http://www.gcf.org/v2.5"
  Labels on "1994.11.05T08: 15-0500"
  Until "1995.12.31T23: 59-0000"
  For "http://w3.org/PICS/Overview.shtml"
  Ratings (suds 0.5 density 0 color / hue 1))
  '>
  <TITLE> ... the name of the document ... </ TITLE>
 </ HEAD>
META and default information

A META element can be used to specify the default information for a document in the following cases:

In the following example, the document specifies the character encoding of ISO-8859-5

 <META http-equiv = "Content-Type" content = "text / html; charset = ISO-8859-5"> 

Metadata Profiles  

The profile attribute of the HEAD element specifies the location of the metadata profile. The value of the profile attribute is a URI. User agents can use this URI in two ways:
  • As a global unique name. User agents can recognize the name (without actually loading the profile) and perform some actions based on known conventions for this profile. For example, search engines can provide an interface for searching in HTML document catalogs, where all these documents use the same profile to represent directory entries.
  • As a link. User agents can dereference URIs and perform some actions based on definitions from a profile (for example, authorizing the use of a profile in the current HTML document). In this specification, profile formats are not defined.

This example uses a hypothetical profile that defines useful properties for indexing documents. For properties defined by this profile - including "author", "copyright", "keywords" and "date" - the values ​​are set using sequential META ads.

  <HEAD profile = "http://www.acme.com/profiles/core">
  <TITLE> How to complete Memorandum cover sheets </ TITLE>
  <META name = "author" content = "John Doe">
  <META name = "copyright" content = "& copy; 1997 Acme Corp.">
  <META name = "keywords" content = "corporate, guidelines, cataloging">
  <META name = "date" content = "1994-11-06T08: 49: 37 + 00: 00">
  </ HEAD>

At the time of writing this specification, it became common practice to use the date formats described in [RFC2068] , section 3.3. Since processing these formats is relatively complicated, we recommend authors to use the date format [ISO8601] . For more information, see the sections on INS and DEL elements.

The scheme attribute allows authors to provide users with additional context for correct interpretation of metadata. Sometimes such additional information can be important, for example, if the metadata is specified in a different format. For example, the author can specify a date in the format "10-9-97" (ambiguous); Does this mean October 9, 1997 or September 10, 1997? The value of the scheme "Month-Date-Year" attribute will eliminate ambiguity.

In other cases, the scheme attribute can provide useful, but not so important information to user agents.

For example, the following scheme declaration will help user agents determine that the value of the "identifier" property is the ISBN code number:

 <META scheme = "ISBN" name = "identifier" content = "0-8230-2355-9">

The value of the scheme attribute depends on the name property and the associated profile .

Note. An example of a profile is Dublin Core (see [DCORE] ). This profile defines a set of recommended properties for electronic bibliographic descriptions and is designed to provide interoperability in incomparable description models.

7.5 The body of the document

7.5.1 The BODY element

  <! ELEMENT BODY OO ( % block; | SCRIPT) + + (INS | DEL) - body of the document ->
 <! ATTLIST BODY
  % Attrs;
  - % coreattrs , % i18n , % events -
  Onload % Script;
  #IMPLIED - document loaded -
  Onunload % Script;
  #IMPLIED - document deleted -
  >

Start tag: optional , End tag: optional

Attribute definitions

Background = uri [CT]
Undesirable. The value of this attribute is a URI pointing to the image. This image is the background (for visual browsers).
Text = color [CI]
Undesirable. This attribute sets the text color (for visual browsers).
Link = color [CI]
Undesirable. This attribute sets the text color for hypertext links that you did not go through (for visual browsers).
Vlink = color [CI]
Undesirable. This attribute sets the text color of the links that you navigated (for visual browsers).
Alink = color [CI]
Undesirable. This attribute sets the color of the link text when they are selected by the user (for visual browsers).

The content of the document is located in the body of the document. The content can be represented by a user agent in several ways. For example, for visual browsers, you can read the body of a document as a canvas, on which the contents are displayed: text, images, colors, pictures, etc. For audio user agents, it can be pronounced. Because the preferred way to specify the presentation of documents is now style sheets , the presentation attributes in the BODY tag are undesirable .

EXAMPLE OF UNDESIRABLE USE:
The following HTML code fragment shows the use of an unwanted attribute . It sets the background color to white, the text black color and the red color of the hyperlinks initially, the fuchsia color when the links are activated, and the brown for the links that you clicked on.

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 Transitional // EN"
  "Http://www.w3.org/TR/REC-html40/loose.dtd">
 <HTML>
 <HEAD>
  <TITLE> Population dynamics </ TITLE>
 </ HEAD>
 <BODY bgcolor = "white" text = "black"
  Link = "red" alink = "fuchsia" vlink = "maroon">
  ... the body of the document ...

 </ BODY>
 </ HTML>

Using style sheets , the same effect can be achieved as follows:

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
  "Http://www.w3.org/TR/REC-html40/strict.dtd">
 <HTML>
 <HEAD>
  <TITLE> Population dynamics </ TITLE>
  <STYLE type = "text / css">
  BODY {background: white;  Color: black}
  A: link {color: red}
  A: {color: maroon}
  A: active {color: fuchsia}
  </ STYLE>
 </ HEAD>
 <BODY>
  ... the body of the document ...

 </ BODY>
 </ HTML>

Using external (linked) style sheets provides the flexibility to modify a view without revising the source of the HTML document:

  <! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.0 // EN"
  "Http://www.w3.org/TR/REC-html40/strict.dtd">
 <HTML>
 <HEAD>
  <TITLE> Population dynamics </ TITLE>
  <LINK rel = "stylesheet" type = "text / css" href = "smartstyle.css">
 </ HEAD>
 <BODY>
  ... the body of the document ...

 </ BODY>
 </ HTML>

Frames and body of HTML documents. In documents containing frames, the BODY element is replaced with the FRAMESET element. For more information, see the section on frames .

7.5.2 Element IDs: id and class attributes

Attribute definitions

Id = name [CS]
This attribute assigns a name to the element. The name within the document must be unique.
Class = cdata-list [CS]
This attribute assigns an element a class name or a set of class names. The same name or class names can be assigned to any number of elements. Multiple class names must be separated by spaces.
The id attribute assigns a unique identifier to the element (which can be checked by the SGML parser). For example, the following paragraphs are recognized by the values ​​of their id attributes:

 <P id = "myparagraph"> This paragraph has a unique name. </ P>
 <P id = "yourparagraph"> This paragraph also has a unique name. </ P>

The id attribute has several roles in HTML:

  • A way to select a style sheet .
  • Purpose (anchor) for hypertext links.
  • A means of referencing a specific element of the script .
  • The name of the declared OBJECT object.
  • In order to process user agents (for example, for identification fields when extracting data from HTML pages to a database, converting HTML documents to other formats, etc.).

The class attribute, on the other hand, assigns one or more class names to the element; While the element can be called belonging to these classes. The class name can be used by several instances of the element. The class attribute has several roles in HTML:

  • A method for selecting a style sheet (when the author wants to assign style information to a set of elements).
  • For general processing by user agents.

Next, the example SPAN element is used in conjunction with the id and class attributes to mark the messages in the document. Messages are displayed in English and Russian versions.

  <! - English messages ->
 <P> <SPAN id = "msg1" class = "info" lang = "en"> Variable declared twice </ SPAN>
 <P> <SPAN id = "msg2" class = "warning" lang = "en"> Undeclared variable </ SPAN>
 <P> <SPAN id = "msg3" class = "error" lang = "en"> Bad syntax for variable name </ SPAN>
  <! - Russian messages ->
 <P> <SPAN id = "msg1" class = "info" lang = "fr"> The variable is declared twice </ SPAN>
 <P> <SPAN id = "msg2" class = "warning" lang = "fr"> Variable not declared </ SPAN>
 <P> <SPAN id = "msg3" class = "error" lang = "fr"> Syntax error in variable name </ SPAN>

The following CSS style rules inform the user agents about the need to display information in green, warnings are yellow, and error messages are red:

  Span.info {color: green}
 SPAN.warning {color: yellow}
 SPAN.error {color: red}

Remember that the Russian "msg1" and the English "msg1" can not be displayed in one document, because they use the same value of the id attribute. Authors can benefit further by using the id attribute to improve the presentation of individual messages, specifying them as targets (anchors), etc.

Almost every HTML element can be assigned an identifier and information about the class.

Suppose we write a document about the programming language. This document should include a number of formatted examples. To format the examples, we use the PRE element. We also assign the background color (green) to all instances of the PRE element belonging to the class "example".

  <HEAD>
 <TITLE> ... the name of the document ... </ TITLE>
 <STYLE type = "text / css">
 PRE.example {background: green}
 </ STYLE>
 </ HEAD>
 <BODY>
 <PRE class = "example" id = "example-1">
 ... the example code ...

 </ PRE>
 </ BODY>

By setting the id attribute for this example, we can (1) create a hyperlink on it and (2) use style information that is different from the one defined in the table for one instance of the style information.

Note. The id attribute uses one namespace with the name attribute, if it is used for anchor names. For more information, see the section on anchors with id .

7.5.3 Block level elements and built-in elements

Some HTML elements that may be present inside the BODY tag are called "block-level" elements, while others are "built-in" (also called "text-level" elements). The difference between them is described below:

Content Model
Typically, block-level elements can contain built-in elements and other block-level elements. Typically, embedded elements can only contain data and other built-in elements. This structural difference is characterized by the idea that the elements of the block create "large" structures than the built-in elements.
Formatting
By definition, the block-level elements are formatted differently than the built-in elements. Typically, block-level elements begin with a new line, and the built-in elements do not. For information about spaces, line breaks, and block formatting, see the text section.
Direction
For technical reasons affecting the bidirectional algorithm [UNICODE] , block-level elements and built-in elements differ in the way inheritance of direction information. For more information, see the inheritance of text directions .

Style sheets provide means for specifying the display of arbitrary elements, including whether the element is generated as a block or inline. In some cases, for example, in the case of a built-in style for list items, this can be useful, but generally speaking, authors should avoid overriding the interpretation of HTML elements.

Changing traditional presentation expressions for block-level elements and embedded elements affects the bidirectional algorithm. For more information, see the section on the effect of style sheets on bidirectionality .

7.5.4 Grouping of elements: elements of DIV and SPAN

  <! ELEMENT DIV - - ( % flow; ) * - common language / style container ->
 <! ATTLIST DIV
  % Attrs;
  - % coreattrs , % i18n , % events -
  >
 <! ELEMENT SPAN - - ( % inline; ) * - common language / style container ->
 <! ATTLIST SPAN
  % Attrs;
  - % coreattrs , % i18n , % events -
  >

Start tag: required , End tag: required

Attribute definitions

Href = uri [CT]
This attribute specifies a resource that provides additional information about the contents of a DIV or SPAN element.

The DIV and SPAN elements together with the id and class attributes provide a common mechanism for adding structures to the documents. These elements define inline information ( SPAN ) or block-level information ( DIV ), but do not impose any other expressions to represent the context. Thus, authors can use these elements with style sheets , lang attributes, and so on.

Suppose you want to generate a document in HTML format based on the customer information database. Because HTML does not include elements for identifying objects such as "client", "phone number", "email address", etc., we use DIV and SPAN elements to achieve the desired structure and presentation effects. To structure the information, we could use the TABLE element as follows:

 <! - Example of data from the customer database: ->
 <! - Name: Stephane Boyera, Phone: (212) 555-1212, Email: [email protected] ->

 <DIV id = "client-boyera" class = "client">
 <P> <SPAN class = "client-title"> Client Information: </ SPAN>
 <TABLE class = "client-data">
 <TR> <TH> Surname: <TD> Boyera </ TR>
 <TR> <TH> Name: <TD> Stephane </ TR>
 <TR> <TH> Tel: <TD> (212) 555-1212 </ TR>
 <TR> <TH> Email: <TD> [email protected] </ TR>
 </ TABLE>
 </ DIV>

 <DIV id = "client-lafon" class = "client">
 <P> <SPAN class = "client-title"> Client Information: </ SPAN>
 <TABLE class = "client-data">
 <TR> <TH> Surname: <TD> Lafon </ TR>
 <TR> <TH> Name: <TD> Yves </ TR>
 <TR> <TH> Tel: <TD> (617) 555-1212 </ TR>
 <TR> <TH> Email: <TD> [email protected] </ TR>
 </ TABLE>
 </ DIV>

We can then easily add a style sheet ad to customize the presentation of these records.

For another example, see the section on class and id attributes.

Visual user agents typically place a newline before and after DIV elements, for example:

 <P> aaaaaaaaaa <DIV> bbbbbbbbb </ DIV> <DIV> in <P> in </ div>

Which is usually generated as:

 Aaaaaaaaaa
 Bbbbbbbbb
 In

 In

7.5.5 Headings: Elements H1 , H2 , H3 , H4 , H5 , H6

  <! ENTITY% heading " H1 | H2 | H3 | H4 | H5 | H6 ">
 <! -
  There are six levels of headers - from H1 (most important) to H6 (least important).
 ->
 <! ELEMENT ( % heading; ) - - ( % inline; ) * - headers ->
 <! ATTLIST ( % heading; )
  % Attrs;
  - % coreattrs , % i18n , % events -
  >

Start tag: required , End tag: required

The title briefly describes the content of the section to which it precedes. Information from the header can be used by user agents, for example, to automatically build a table of contents for a document.

In HTML, there are six levels of headers: H1 - the most important - and H6 - the least important. Visual browsers usually display more important headlines in a larger font.

The following example shows how to use a DIV element to associate a header with a subsequent section of a document. This will allow you to define the style for the section (background color, font, etc.) using style sheets.

 <DIV class = "section" id = "forest-elephants"> <H1> Forest elephants </ H1> <P> In this section, we discuss lesser known forest elephants.  ... continued section ... <DIV class = "subsection" id = "forest-habitat"> <H2> Arial </ H2> <P> Forest elephants do not live in trees, but among them.  ... continued section ... </ DIV> </ DIV> 

This structure can be represented using style information, for example:

  <HEAD>
 <TITLE> ... the name of the document ... </ TITLE>
 <STYLE type = "text / css">
 DIV.section {text-align: justify;  Font-size: 12pt}
 DIV.subsection {text-indent: 2em}
 H1 {font-style: italic;  Color: green}
 H2 {color: green}
 </ STYLE>
 </ HEAD>

Numbered sections and references
HTML does not generate partition numbers from headers. This can be done by user agents. Soon, the description languages ​​of style sheets, such as CSS, will give authors the ability to control the generation of section numbers (for convenience in references in printed documentation, for example "See Section 7.2").

Some people consider skipping header levels in a bad tone. They take the order of the headers H1 H2 H1 , but do not take the order of H1 H3 H1 , since the H2 level is skipped.

7.5.6 The ADDRESS element

  <! ELEMENT ADDRESS - - ( % inline; ) * - information about the author ->
 <! ATTLIST ADDRESS
  % Attrs;
  - % coreattrs , % i18n , % events -
  >

Start tag: required , End tag: required

The ADDRESS element can be used by authors to specify contact information or a body of a document, such as a form. This element is often at the beginning or end of the document.

For example, a page on a W3C server that refers to an HTML language can include the following contact information:

 <ADDRESS>
 <P> <A href="../People/Raggett/"> Dave Raggett </A>, 
  <A href="../People/Arnaud/"> Arnaud Le Hors </A>, 
 Contact person for the <A href="Activity"> W3C HTML Activity </A> <BR> 
 $ Date: 1997/12/16 05:38:14 $
 </ ADDRESS>