Home  >  Article  >  Web Front-end  >  HTML Tutorial: Definition List_HTML/Xhtml_Web Page Production

HTML Tutorial: Definition List_HTML/Xhtml_Web Page Production

WBOY
WBOYOriginal
2016-05-16 16:46:071506browse

Original text: http://andymao.com/andy/post/104.html
Previous section: Ordered list
After writing "Unordered List" and "Ordered List", someone has told me that these two articles are not interesting. If these two articles are only read in one-way reading, then it is indeed meaningless, but the important thing about these two articles is that they require readers to add their own thinking. Ordered and unordered single tags are very simple, as long as you know how to use them, but I think the key point is not to know what the tag looks like, the key point is to know what kind of list is suitable for what kind of data. What kind of data is ordered and what kind of data is unordered? Think after reading, so that you can learn something and the knowledge can be your own.
Definition lists have a special form and usage. Compared with unordered lists, definition lists are used much less often. There are also many friends who have not started using this list, so let’s break down the code of this list:




Looking at the above code, we find that the
  • tag does not appear here, but consists of three tags: DL, DT, and DD. Based on the appearance and the previous list, we can know that DL is a container for this list. , just like a box, the difference is that this time there is not only a single small box of uniform standards in the box. Instead, two different contents appear. How do we understand this DT and DD? Semantically speaking, DT is the name, the title, and DD is the explanation, the content. DT and DD are both boxes. DD only corresponds to the explanation of a DT above it, and cannot be interpreted beyond the level or downward. When DT does not exist, then DD has no meaning of existence, and whether DT necessarily needs DD to follow it, I have not found the exact literature to explain this point, but based on my understanding of the definition list, I I think that if there is only DT and no DD in the data, then this cannot be a definition list, and just use a UL unordered list. But when only one or a few of the data do not have DD, and most of them have DD, then I think this form can exist.

    Ordered list

    Ordered list

    Ordered list

    Ordered list


    The above is obviously inappropriate. This form is an unordered list. Why use a definition list? It doesn’t make sense semantically.

    Ordered list

    An ordered list is a data form in which sequenced data is organized in a list

    Ordered list

    An ordered list is a data form in which sequenced data is organized into a list

    There is no explanation for this sentence

    Ordered list

    Ordered list is a data form in which sequenced data is organized into a list


    I personally think the above form is feasible. So can one DT carry multiple DDs? I have also found no literature stating that this is not possible, and there are still many examples of one DT with multiple DDs on some well-known websites. My opinion on this is that under special circumstances it is okay to have one DT with multiple DDs, but in general I think this approach is still lacking. From an interpretation point of view, do multiple DDs indicate multiple interpretations? Or the explanation should be divided into paragraphs, and there is no need to let DD be the dog that catches the mouse. Many paragraph tags can be embedded in a DD. Furthermore, from the perspective of style application, multiple DDs are loose as a whole and their design is not scalable enough. For example, when we want to create the effect of clicking DT to hide the corresponding DD, this multi-DD approach is not so easy to implement. Therefore, if it is not for special purposes, try not to use one DT with multiple DDs. Instead, put the content in the DD. For segmentation, use paragraph tags. For segmentation, use ordered or unordered lists. To perform.
    Let’s talk about it from the beginning. The label itself is nothing. The important thing is to think about how to apply it. Here is a picture for you to see whether you should use a custom list. Let’s discuss it together.
  • Statement:
    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