当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML 列表

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML 列表


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 1037 ::
收藏到网摘: n/a

HTML supports ordered, unordered and definition lists.
HTML是支持有序,无序以及自定义列表的。


Examples
例子

An unordered list
无序列表
This example demonstrates an unordered list.
这个案例展示了一个无序列表。

An ordered list
有序列表
This example demonstrates an ordered list.
这个案例展示了一个有序列表。


Unordered Lists
无序列表

An unordered list is a list of items. The list items are marked with bullets (typically small black circles).
一个无序列表就是一列项目。每个项目都由一个标记所标识(一般就是小黑圈)

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
一个无序列表的开头是用<ul>标签。 每个项目的开始标签为<li> 。

<ul>

<li>Coffee</li>
<li>Milk</li>
</ul>

Here is how it looks in a browser:
显示效果:

  • Coffee
  • Milk


Inside a list item you can put paragraphs, line breaks, images, links, other lists, etc.
在列表项目中你可以加入段落、回车符、图象、连接、以及另外的列表、等等。


Ordered Lists
有序列表

An ordered list is also a list of items. The list items are marked with numbers.
有序列表也是一列项目。每个项目前都有数字标记。

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
有序列表的开始一标签是<ol>。每个项目的开始标签还是<li>。

<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

Here is how it looks in a browser:
效果为:

  1. Coffee
  2. Milk


Inside a list item you can put paragraphs, line breaks, images, links, other lists, etc.
同样的,在项目中你可以添加列如段落、回车符、图象、连接、以及另外的列表、等等。


Definition Lists
释义列表

A definition list is not a list of items. This is a list of terms and explanation of the terms.
释义列表就不是一列项目了,而是一列实物以及于其相关的解释。

A definition list starts with the <dl> tag. Each definition-list term starts with the <dt> tag. Each definition-list definition starts with the <dd> tag.
释义列表的开始标签是<dl>。每个被解释的事物的开始标签为<dt>。每个解释的内容的开始标签是<dd>。

<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>

<dd>White cold drink</dd>
</dl>

Here is how it looks in a browser:
在浏览器下的效果

Coffee
Black hot drink
Milk
White cold drink


Inside a definition-list definition (the <dd> tag) you can put paragraphs, line breaks, images, links, other lists, etc.
在<dd>标签中的内容可以是段落、回车符、图象、连接、或者是其他的列表、等。


More Examples
更多的例子

Different types of ordered lists
各种不同样式的有序列表
This example demonstrates different types of ordered lists.
这个案例展示了 各种不同样式的有序列表。

Different types of unordered Lists
各种不同样式的无序列表
This example demonstrates different types of unordered lists.
这个案例展示了 各种不同样式的无序列表。

Nested list
嵌套列表
This example demonstrates how you can nest lists.
这个案例展示了嵌套列表。

Nested list 2
多个嵌套列表
This example demonstrates a more complicated nested list.
这个案例展示了多个复杂的嵌套列表。

Definition list
释义列表
This example demonstrates a definition list.
这个案例展示了一个释义列表。


List Tags
列表标签一览

Tag
标签
Description
描述
<ol> Defines an ordered list
定义有序列表
<ul> Defines an unordered list
定义无序列表
<li> Defines a list item
定义列表内容项
<dl> Defines a definition list
定义列表
<dt> Defines a definition term
定义项
<dd> Defines a definition description
定义描述
<dir> Deprecated. Use <ul> instead
不推荐,用<ul>取代
<menu> Deprecated. Use <ul> instead
不推荐,用<ul>取代

评论 (1) 1 All

登陆 | 还没注册?