What's the
tag for?

前端 未结 3 419
走了就别回头了
走了就别回头了 2021-02-03 18:04

Is there any logical reason for using the

,
and
tags instead of nested, CSS-styled
    and
      tags? Or are they just an outdated g
3条回答
  •  感情败类
    2021-02-03 18:27

    Citing the W3C spec:

    The dl element represents an association list consisting of zero or more name-value groups (a description list). Each group must consist of one or more names (dt elements) followed by one or more values (dd elements). Within a single dl element, there should not be more than one dt element for each name.

    So the main reason for the

    ,
    and
    tags are to preserve the semantic connection for those name-value pairs, which would get lost, if you just used nested lists.

    If you use nested lists, this could be done for various reasons (currently, e.g., many menus are structured into nested lists) and crawlers or any other system, that respects semantic annotations, would not be able to tell the difference.

    If you use the above tags, however, a system can see the connection and act accordingly. So a future use maybe to extract all definitions of terms inside a larger document to create some kind of glossary.

提交回复
热议问题