(HTML learning record): list tag

table of Contents

List label (emphasis)

Unordered list ul (emphasis)

Ordered list ol (understand)

Custom list (understanding)

List summary


List label (emphasis)

  • concept:
    • A form of text or graphics with consistent structure and style is loaded in the container, called a list
  • Features:
    • The most important feature of the list is that it is neat, tidy, and orderly. It is similar to the table, but it has a higher degree of freedom in combination.

Unordered list ul (emphasis)

  • Each list item in an unordered list has no order levels, and they are parallel . The basic syntax format is as follows
<ul>
  <li>列表项1</li>
  <li>列表项2</li>
  <li>列表项3</li>
  ......
</ul>
  • For example, in the following, news is in no order, there is no need to queue, first come first served, and then published first.

  • Only <li></li> can be nested in <ul></ul>. It is not allowed to directly enter other tags or text in the <ul></ul> tag.
  • The space between <li>and</li> is equivalent to a container, which can hold all elements .
  • Unordered lists will have their own style attributes, put down that style, and let CSS come

Ordered list ol (understand)

 

  • An ordered list is an ordered list, and each list item is arranged and defined in a certain order. The basic syntax format of an ordered list is as follows:
<ol>
  <li>列表项1</li>
  <li>列表项2</li>
  <li>列表项3</li>
  ......
</ol>
  • All features are basically the same as ul. But in practice it is much less used than unordered lists.

Custom list (understanding)

  • The definition list is often used to explain and describe terms or nouns. There is no bullet before the list items in the definition list. The basic syntax is as follows:
<dl>
  <dt>名词1</dt>
  <dd>名词1解释1</dd>
  <dd>名词1解释2</dd>
  ...
  <dt>名词2</dt>
  <dd>名词2解释1</dd>
  <dd>名词2解释2</dd>
  ...
</dl>

List summary

Label name definition Description
<ul></ul> Unordered tags It can only contain li in no order, the most commonly used list in our future layout
<ol></ol> Ordered label It can only contain li in order, which is less used
<dl></dl> Custom list There are 2 brothers, dt and dd

Guess you like

Origin blog.csdn.net/baidu_41388533/article/details/108680273