当前位置:网络资源中心文章中心网页设计HTML/CSS → 文章内容

HTML语言剖析(六)清单标记 (1)

减小字体 增大字体 作者:阿辉  来源:网咯收集  发布时间:2008-5-16 15:43:45
%26lt;OL%26gt; %26lt;LI%26gt;
%26lt;UL%26gt;
%26lt;MENU%26gt; %26lt;DIR%26gt;
%26lt;DL%26gt; %26lt;DT%26gt; %26lt;DD%26gt; ■ %26lt;OL%26gt; %26lt;LI%26gt; :▲Top%26lt;OL%26gt;称为顺序清单标记。%26lt;LI%26gt;则用以标示清单项目。
所谓顺序清单就是在每一项前面加上 1,2,3... 等数目,又称编号清单。

%26lt;OL%26gt; 的参数设定(常用)
例如 %26lt;ol type="i" start="4"%26gt;%26lt;/ol%26gt;

type="i"
设定数目款式,其值有五种,请参考 右表,内定为 type="1"。 start="4"
设定开始数目,不论设定了哪一数 目款式,其值只能是 1,2,3.. 等整 数,内定为 start="1"。 TypeNumbering style1arabic numbers1, 2, 3, ...alower alphaa, b, c, ...Aupper alphaA, B, C, ...ilower romani, ii, iii, ...Iupper romanI, II, III, ...

%26lt;LI%26gt; 的参数设定(常用)
例如 %26lt;li type="square" value="4"%26gt; type="square"
只适用于非顺序清单,设定符号款式,其值有三种,如下,内定为 type="disc"
符号 是当 type="disc" 时的列项符号。
符号 if" width=10 height=10 border=0%26gt; 是当 type="circle" 时的列项符号。
符号 是当 type="square" 时的列项符号。 value="4"
只适用于顺序清单,设定该一项的数目,其後各项将以此作为起始数目而递增, 但前面各项则不受影响,其值只能是 1,2,3.. 等整数,没有内定值。

例子 HTML Source Code (原始码)浏览器显示结果My best friends:
%26lt;ol%26gt;
%26lt;li%26gt;Michelle Wei
%26lt;li%26gt;Michael Wan
%26lt;li%26gt;Gloria Lam
%26lt;/ol%26gt; My best friends:

    Michelle Wei Michael Wan Gloria Lam

■ %26lt;UL%26gt; ▲Top%26lt;UL%26gt;称为无序清单标记。
所谓无序清单就是在每一项前面加上 等符号,故又称符号清单。

%26lt;UL%26gt; 的参数设定(常用)
例如 %26lt;UL type="square"%26gt; type="square"
设定符号款式,其值有三种,如下,内定为 type="disc"
符号 是当 type="disc" 时的列项符号。
符号 是当 type="circle" 时的列项符号。
符号 是当 type="square" 时的列项符号。

注重由于 %26lt;UL%26gt; 及 %26lt;LI%26gt; 都有 type 这个参数,两者尽可能选用其一。

例子 HTML Source Code (原始码)浏览器显示结果My Homepages:
%26lt;ul%26gt;
%26lt;li%26gt;Penpals Garden
%26lt;li%26gt;ICQ Garden
%26lt;li%26gt;Software City
%26lt;li%26gt;Creation of Webpage
%26lt;/ul%26gt; My Homepages: Penpals Garden ICQ Garden Software City Creation of Webpage

■ %26lt;MENU%26gt; %26lt;DIR%26gt; ▲Top这两个标记都不为 W3C 所赞同,希望用者能以 %26lt;ul%26gt; 及 %26lt;ol%26gt; 代之。
%26lt;MENU%26gt; 及 %26lt;DIR%26gt;,基本上它和 %26lt;ul%26gt; 是一样的,在一些非凡的浏览器可能表现出 %26lt;ol%26gt; 的 效果,于旧版的 IE 或 NC 标记 %26lt;DIR%26gt; 不显示符号或数目。两标记的用法与 %26lt;ul%26gt; 完全一 样。

例子 HTML Source Code (原始码)浏览器显示结果My Homepages:
%26lt;dir%26gt;
%26lt;li%26gt;Penpals Garden
%26lt;li%26gt;ICQ Garden
%26lt;li%26gt;Software City
%26lt;li%26gt;Creation of Webpage
%26lt;/dir%26gt; My Homepages:

Penpals Garden ICQ Garden Software City Creation of Webpage

■ %26lt;DL%26gt; %26lt;DT%26gt; %26lt;DD%26gt; :▲Top%26lt;DL%26gt;称为定义清单标记。 %26lt;DT%26gt; 用以标示定义条目,%26lt;DD%26gt; 则用以标示定义内容。
所谓定义清单就是一种分二层的项目清单,其不故符号及数目。

三个标记都没有常用的参数。而 %26lt;DT%26gt; %26lt;DD%26gt; 可以独立使用,只是一些旧的浏览器并不支 援,如 IE 3.0。常用的如 %26lt;DD%26gt; 标记可用以制造段落第一个字前面的空白。

例子 原始码%26lt;dl%26gt;
%26lt;dt%26gt;How to use Definition List
%26lt;dd%26gt;First, you should not place paragraph tag right after or before a list structure or between the items of a list. In cerntain contexts, use of extra paragraph tags should always be avoided, when you realize this concept, it is quit easy to write a HTML.
%26lt;dt%26gt;Other things to know
%26lt;dd%26gt;We usually put only ONE Definition tag following the Definition Term tag, more than one DD tag is not recommanded. Besides, unlike Definition List is a nonempty tag, both Definition Term and Definition Description are empty tags.
%26lt;/dl%26gt; 显示结果

How to use Definition List
First, you should not place paragraph tag right after or before a list structure or between the items of a list. In cerntain contexts, use of extra paragraph tags should always be avoided, when you realize this concept, it is quit easy to write a HTML.
Other things to know
We usually put only ONE Definition tag following the Definition Term tag, more than one DD tag is not recommanded. Besides, unlike Definition List is a nonempty tag, both Definition Term and Definition Description are empty tags.