Table of Contents
1. Ordered list
2. Unordered list
3. 定义列表
4. 总结
Home Web Front-end Front-end Q&A HTML provides several list modes

HTML provides several list modes

Nov 17, 2021 pm 04:41 PM
html

HTML provides 3 list modes: 1. Ordered list, created using "

    " and "
  1. " 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.

HTML provides several list modes

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:

  • Ordered list, use
    1. tag
    2. Unordered list , use
      • tag
      • to define the list, use
        tag

      1. Ordered list

      In HTML, the

        tag is used to represent an ordered list. The content in an ordered list has a sequence, such as a series of steps in a recipe. These steps need to be completed in order. In this case, an ordered list can be used.

        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>
        Copy after login

        HTML provides several list modes

        Ordered lists require the use of

          and
        1. tags:

            1. is the abbreviation of order list, which means an ordered list. It can number each item in the list, starting from the number 1 by default.
            2. is the abbreviation of list item, which represents each item in the list. The number of
            3. in
                indicates how many pieces of content there are. List items can contain text, images, links, etc., or even another list.

          Note that

            is generally used in conjunction with
          1. and will not appear alone, and it is not recommended to use other tags other than
          2. directly in
              .

              2. Unordered list

              HTML uses the

                tag to represent an unordered list. Unordered lists are similar to ordered lists, both use the
              • tag to represent each item in the list, but the contents in the unordered list are not in order. For example, the types of breakfast do not need to indicate the order, then an unordered list can be used.

                Let’s look at a simple example:

                <!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>
                Copy after login
                <!DOCTYPE html>
                <html lang="en">
                <head>
                    <meta charset="UTF-8">
                    <title>HTML无序列表</title>
                </head>
                <body>
                    <p>早餐的种类:</p>
                    <ul>
                        <li>鸡蛋</li>
                        <li>牛奶</li>
                        <li>面包</li>
                        <li>生菜</li>
                    </ul>
                </body>
                </html>
                Copy after login

                浏览器运行结果如图所示:

                HTML provides several list modes

                无序列表需要使用

                • 标签:

                    • 是 unordered list 的简称,表示无序列表。
                        1. 中的
                        2. 一样,都表示列表中的每一项。默认情况下,无序列表的每一项都使用符号表示。

                      注意,

                        一般和
                      • 配合使用,不会单独出现,而且不建议在
                          中直接使用除
                        • 之外的其他标签。

                          3. 定义列表

                          在 HTML 中,

                          标签用于创建定义列表。定义列表由标题(术语)和描述两部分组成,描述是对标题的解释和说明,标题是对描述的总结和提炼。

                          定义列表具体语法格式如下:

                          <dl>
                              <dt>标题1<dt>
                              <dd>描述文本2<dd>
                              <dt>标题2<dt>
                              <dd>描述文本2<dd>
                              <dt>标题3<dt>
                              <dd>描述文本3<dd>
                          </dl>
                          Copy after login

                          定义列表需要使用

                          标签:

                          • 是 definition list 的简称,表示定义列表。
                          • 是 definition term 的简称,表示定义术语,也就是我们说的标题。
                          • 是 definition description 的简称,表示定义描述 。

                          可以认为

                          定义了一个概念(术语),
                          用来对概念(术语)进行解释。

                          注意,

                          是同级标签,它们都是
                          的子标签。一般情况下,每个
                          搭配一个
                          ,一个
                          可以包含多对


                          我们来看一个简单的例子:

                          <!DOCTYPE html>
                          <html>
                          <head>
                              <meta charset="UTF-8">
                              <title>HTML定义列表</title>
                          </head>
                          <body>
                              <dl>
                                  <dt>HTML</dt>
                                  <dd>HTML 是一种专门用来开发网页的标记语言,您可以转到《<a href="http://www.php.cn/course/list/11.html" target="_blank">HTML教程</a>》了解更多。</dd>
                                  <dt>CSS</dt>
                                  <dd>CSS 层叠样式表可以控制 HTML 文档的显示样式,用来美化网页,您可以转到《<a href="https://www.php.cn/course/list/12.html" target="_blank">CSS教程</a>》了解更多。</dd>
                                  <dt>JavaScript</dt>
                                  <dd>JavaScript 简称 JS,是一种用来开发网站(包括前端和后台)的脚本编程语言,您可以转到《<a href="https://www.php.cn/course/list/2.html" target="_blank">JS教程</a>》了解更多。</dd>
                              </dl>
                          </body>
                          </html>
                          Copy after login

                          HTML provides several list modes

                          虽然是同级标签,但是它们的默认样式不同,
                          带有一段缩进,而
                          顶格显示,这样层次更加分明。

                          4. 总结

                          列表分类 说明
                          有序列表
                            表示有序列表,
                          1. 表示列表中的每一项,默认使用阿拉伯数字编号。
                          无序列表
                            表示无序列表,
                          • 表示列表中的每一项,默认使用符号作为作为每一项的标记。
                          定义列表
                          表示定义列表,
                          表示定义术语、
                          表示定义描述。一般情况下,每个
                          搭配一个
                          ,一个
                          可以包含多对

                          推荐教程:《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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles