" and "
Home >Web Front-end >Front-end Q&A >HTML provides several list modes
HTML provides 3 list modes: 1. Ordered list, created using "
" and "
- " tags, the contents between the ordered lists are in order; 2. Create an unordered list using the "
" and "
- " tags; 3. Define the list using the "
", "
- " and "
- " tags create.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
HTML list (List) can organize several related pieces of content to make the content look more organized. Within lists you can place text, images, links, etc. You can also define a list within another list (nested lists).
HTML provides us with three different forms of lists:
In HTML, the
Let’s look at a simple example:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>HTML有序列表</title> </head> <body> <p>煮米饭的步骤:</p> <ol> <li>将水煮沸</li> <li>加入一勺米</li> <li>搅拌均匀</li> <li>继续煮10分钟</li> </ol> </body> </html>
Ordered lists require the use of
Note that
HTML uses the
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>HTML无序列表</title> </head> <body> <p>早餐的种类:</p> <ul> <li>鸡蛋</li> <li>牛奶</li> <li>面包</li> <li>生菜</li> </ul> </body> </html>
浏览器运行结果如图所示:
无序列表需要使用
●
符号表示。注意,
在 HTML 中,
<dl> <dt>标题1<dt> <dd>描述文本2<dd> <dt>标题2<dt> <dd>描述文本2<dd> <dt>标题3<dt> <dd>描述文本3<dd> </dl>
定义列表需要使用
可以认为
注意,
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>HTML定义列表</title> </head> <body> <dl> <dt>HTML</dt> <dd>HTML 是一种专门用来开发网页的标记语言,您可以转到《<a href="//m.sbmmt.com/course/list/11.html" target="_blank">HTML教程</a>》了解更多。</dd> <dt>CSS</dt> <dd>CSS 层叠样式表可以控制 HTML 文档的显示样式,用来美化网页,您可以转到《<a href="//m.sbmmt.com/course/list/12.html" target="_blank">CSS教程</a>》了解更多。</dd> <dt>JavaScript</dt> <dd>JavaScript 简称 JS,是一种用来开发网站(包括前端和后台)的脚本编程语言,您可以转到《<a href="//m.sbmmt.com/course/list/2.html" target="_blank">JS教程</a>》了解更多。</dd> </dl> </body> </html>
列表分类 | 说明 |
---|---|
有序列表 |
|
无序列表 |
|
定义列表 |
|
推荐教程:《html视频教程》
The above is the detailed content of HTML provides several list modes. For more information, please follow other related articles on the PHP Chinese website!