Nested lists

Nested lists are used for organizing complex hierarchical structure of a text, usually documents, such as legal or technical. on the web page can not really automatically lead multilevel numbering, such as the use of sub-items such as 1.1 or 2.1.3. Therefore it is necessary to enter the number yourself or simplify the list display. Thus, in Example 1, a list of clauses and subclauses are indicated by numbers. To properly organize the attachment lists the tag <OL>, forming sub-items should be placed inside the tag <LI>.

Example 1. Creating a nested numbered list

valid HTML
<DOCTYPE HTML PUBLIC! "- // W3C // DTD HTML 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Nested Lists </ title>
</ Head>
<Body>
<Hr>

<Ol>
<li> Paragraph 1
<Ol>
<Li> Paragraph 1.1 </ li>
<Li> Paragraph 1.2 </ li>
</ Ol>
</ li>
<li> Item 2
<Ol>
<Li> Paragraph 2.1 </ li>
<Li> Paragraph 2.2 </ li>
</ Ol>
</ li>
</ Ol>

<Hr>
</ Body>
</ Html>

The result of this example is shown below. Please note that there is a sub-indent on the left, but there is no vertical indentation on the top and bottom of the list, as is usually the case with the tag <OL>.

Fig. 1

Fig. 1. Type of nested numbered list

and bulleted lists can be used similarly. In this case the attached list automatically changes the form of markers (example 2).

Example 2. Creating a nested bulleted list

valid HTML
<DOCTYPE HTML PUBLIC! "- // W3C // DTD HTML 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Nested Lists </ title>
</ Head>
<Body>

<Ul>
<Li> Paragraph 1
<Ul>
<Li> Paragraph 1.1 </ li>
<Li> Paragraph 1.2 </ li>
</ Ul>
</ Li>
<Li> Item 2
<Ul>
<Li> Paragraph 2.1 </ li>
<Li> Paragraph 2.2 </ li>
</ Ul>
</ Li>
</ Ul>

</ Body>
</ Html>

The result of this example is shown below.

Fig. 2

Fig. 2. Type of nested bulleted list

© Policy Copyright www.htmlbook.ru