Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the types of lists in html5

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what are the types of lists in html5". In daily operation, I believe many people have doubts about what types of lists in html5 are divided into. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what types of lists in html5"! Next, please follow the editor to study!

There are three kinds of lists in html5: 1, unordered lists, defined using "and" tags; 2, ordered lists, defined using "" and "" tags; and 3, defining lists, using "", "" and "" tags to define.

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

Unordered list (unordered list)

Function: add unordered list semantics to a pile of content (an unordered whole), and the items in the list are in no order

Format:

Li is list item in English and translated into list items

Choose the city of residence (CN) Beijing, Shanghai, Guangzhou Tieling

Ul application scenarios:

Navigation bar

List of goods, etc.

News list

Note:

Disorder here means that there is no priority for the subject. For example, the theme is "CN". Beijing and Shanghai are all Chinese cities, no matter who puts them first. If the title is changed to "China haze ranking", then there must be a strict ranking, and Beijing must write at the front.

Browsers will automatically add leading symbols to unordered lists, but be sure to remember that the function of ul is not to add dots to text, but to increase the semantics of unordered lists.

In fact, ul also has a type attribute, which can modify the style of the leading symbol. The values include disc, square, and circle.

But since the style will be done through css in the future, I won't introduce it to you here.

Ul is a group tag, which must appear one by one, that is to say, li tags cannot exist alone and must be wrapped in ul.

Since ul and li are a whole, it is not recommended to package other tags in ul. Always remember that it is best to write only li tags in ul.

Although it is recommended that you can only write li tags in ul, the li tag is a container tag, and you can add any tag or even ul tag to the li tag.

Ordered list of delicious milk bread, daily towels and toothpaste (ordered list)

Function: add ordered list semantics (a sequential whole) to a pile of content, with items in the list in order

Format:

House prices in China rank high in Beijing, Shanghai, Guangzhou and Tieling.

Ol application scenarios:

Xxx ranking

In fact, there are not many ol application scenarios, because anything that can be done with ol can be done with ul.

Note:

The semantics of ol and ul are different. How to use them is the same and the points for attention are the same.

In fact, ul also has two common attributes, start and type, which can modify the style and serial number of the leading symbol.

But since the style will be done through css in the future, I won't introduce it to you here.

Definition list (definition list)

Function: add list semantics to a pile of content, list the items in the list through dt, and then describe each entry through dd

Format:

Dt English definition title, translated into definition title

Dd English definition description, translated into definition description information

The capital of Beijing, the place where the national flag is raised, Shanghai Modu, is full of gold.

Dl application scenarios:

Relevant information at the bottom of the website

Whenever you see a pile of content that is used to describe something, you have to think of dl.

Note:

-dl is a group tag, which must appear one by one. In other words, dt and dd tags cannot exist alone. They must be wrapped in dl.

Since dl, dt and dd are integrated, it is not recommended to package other tags in dl.

Dd and dt are container tags like li tags, and any tag can be added to it.

The definition list is very flexible. You can configure multiple dd for a dt, but it is best not to have multiple dt corresponding to one dd. The semantics of dd is to describe the nearest dt, so other dt is equivalent to no description. The meaning of the definition list is that it can not only list each entry but also describe each entry.

Defining lists is flexible and allows you to split multiple dt+dd combinations into multiple dl

At this point, the study of "what types of lists in html5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report