How to use list in html

下次还敢
Release: 2024-04-27 21:21:18
Original
358 people have browsed it

A list is an element in HTML used to display a sequence of items. There are two types of unordered lists and ordered lists, marked with dots or numbers/letters respectively. The syntax is

    and
      , and the list type, starting value, etc. can be specified through attributes. Lists can be nested, creating sublists within list items.

How to use list in html

Usage of lists in HTML

What is a list?

A list is an element in HTML used to display a series of related or ordered items.

Type

There are two types of lists in HTML:

  • Unordered list (
      ): Used to display unsorted items, usually marked with dots or dashes.
    • Ordered list (
        ): Used to display sorted items, usually marked with numbers or letters.

    Syntax

    The syntax for a list is as follows:

    • 项目 1
    • 项目 2
    • 项目 3
    Copy after login

    Attributes

    • ##type: Specifies the list type, which can be "disc" (dot), "circle" (circle) or "square" (square), etc.
    • start: Specifies the starting value of the ordered list.

    Nested lists

    Lists can be nested, that is, sublists are created within list items:

    • 项目 1
      • 子项目 1
      • 子项目 2
    • 项目 2
    Copy after login

    Example

    Unordered list:

    • 苹果
    • 香蕉
    • 橙子
    Copy after login

    Ordered list:

    1. 星期一
    2. 星期二
    3. 星期三
    Copy after login

    Nested list:

    • 动物
    • 水果
    Copy after login

    The above is the detailed content of How to use list in html. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!