您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

HTML 初学者指南(三)

2025/8/10 2:05:20发布26次查看
列表lists
html 支持不编号 unnumbered, 编号numbered, 和定义definition 三种列表. 你也可以嵌套列表, 但是不要嵌套过多,否则会使读者感到不清晰。
不编号列表unnumbered lists
制作一个不编号的,公告式列表,
用开始标记 <ul> ( unnumbered list 的简记) 开始 
输入 <li> (list item) 标记,后面跟独立的项; 不需使用 </li> 标记 
用 </ul> 标记结束整个列表 
下面是一个有三个项的列表:
<ul>
<li> apples
<li> bananas
<li> grapefruit
</ul>
输出形式为:
apples 
bananas 
grapefruit 
<li> 项可以含有多个段落. 用段落标记 <p> 指明.
编号列表numbered lists
编号列表 (也称为 有序列表ordered list) 和不编号列表相同, 只是用 <ol> 代替 <ul>. 各项同样用 <li> 标记. 下面的 html 代码:
<ol>
<li> oranges
<li> peaches
<li> grapes
</ol>
产生的输出为:
oranges 
peaches 
grapes 
定义列表definition lists
定义列表 (编码为 <dl>) 通常含有交替出现的 定义术语definition term (编码为 <dt>) 和定义描述definition definition (编码为 <dd>). web 浏览器通常另起一行显示定义描述.
下面是一个定义列表的例子:
<dl>
<dt> ncsa
<dd> ncsa, the national center for supercomputing applications,
is located on the campus of the university of illinois 
at urbana-champaign. 
<dt> cornell theory center
<dd> ctc is located on the campus of cornell university in ithaca,
new york. 
</dl>
输出形式为:
ncsa 
ncsa, the national center for supercomputing applications, is located on the campus of the university of illinois at urbana-champaign. 
cornell theory center 
ctc is located on the campus of cornell university in ithaca, new york. 
<dt> 和 <dd> 项可以包含多个段落 (用 <p> 标记指示), 列表, 或其他的定义信息.
compact 属性可能会被经常使用,如果你的定义术语很简短的话. 例如,如果你想显示一些计算机选项, 它们可以和定义的开始处于同一行中.
<dl compact>
<dt> -i
<dd>invokes ncsa mosaic for microsoft windows using the 
initialization file defined in the path
<dt> -k
<dd>invokes ncsa mosaic for microsoft windows in kiosk mode
</dl>
输出形式为:
-i 
invokes ncsa mosaic for microsoft windows using the initialization file defined in the path. 
-k 
invokes ncsa mosaic for microsoft windows in kiosk mode. 
嵌套列表nested lists
列表可以嵌套. 在每个列表项中,你还可以含有多个段落,每个段落含有嵌套列表.
以上就是html 初学者指南(三)的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product