How to semantically add heading to a list

后端 未结 8 1917
借酒劲吻你
借酒劲吻你 2020-12-04 10:23

This has been bothering me for a while, and I\'m wondering if there\'s any consensus on how to do this properly. When I\'m using an HTML list, how do I semantically include

8条回答
  •  一向
    一向 (楼主)
    2020-12-04 11:02

    According to w3.org (note that this link is in the long-expired draft HTML 3.0 spec):

    An unordered list typically is a bulleted list of items. HTML 3.0 gives you the ability to customise the bullets, to do without bullets and to wrap list items horizontally or vertically for multicolumn lists.

    The opening list tag must be

      . It is followed by an optional list header (caption) and then by the first list item (
    • ). For example:

        Table Fruit
      • apples
      • oranges
      • bananas

      which could be rendered as:

      Table Fruit

      • apples
      • oranges
      • bananas

      Note: Some legacy documents may include headers or plain text before the first LI element. Implementors of HTML 3.0 user agents are advised to cater for this possibility in order to handle badly formed legacy documents.

提交回复
热议问题