List tag of html tag

HTML list tags are mainly divided into three types, ordered list, unordered list and definition list.

1. Ordered list:

An ordered list, as the name implies, is an ordered list. Generally used for ranking etc.

The main tags involved in the ordered list:

<ol>Label: ordered list label

  • <ol>The elements in the label are ordered and have their own serial number;

  • <ol><li>Do not write anything other than the label in the label;

<li>label:

  • <li>It is a block and an element, on its own line.

  • <li>The content of ol is stored in the label

  • <li>Tags can nest other tags

format:

<ol>
      <li>我是有序列表内容</li>
</ol>

2. Unordered list:

Unordered list, there is no order between each heading, the default is a dot.

<ul>Label: Unordered list label.

<ol>Do not write anything other than li inside

format:

<ul>
     <li>我是无序列表内容</li>
</ul>

Example:

<h2>兴趣爱好</h2>
<ul>
    <li>
        <h3>男生</h3>
        <ul>
            <li>打篮球</li>
            <li>玩游戏</li>
            <li>踢足球</li>
        </ul>
    </li>
    <li>
        <h3>女生</h3>
        <ul>
            <li>看小说</li>
            <li>看电视</li>
            <li>吃东西</li>
        </ul>
    </li>
</ul>

3. Definition list:

Some content for customization.

<dl>Label: Custom list label

<dt>Label: is to define the title

  • <dt>It is a block-level element on its own line;

<dd>Label: Define attributes

  • <dd>It is a block-level element on its own line;

  • <dd>The content is unordered without a serial number;

format:

<dl>
      <dt></dt>
      <dd></dd>
      <dt></dt>
      <dd></dd>
<dl>

Guess you like

Origin blog.csdn.net/QIANDXX/article/details/110667231