How to semantically add heading to a list

后端 未结 8 1877
借酒劲吻你
借酒劲吻你 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:20

    In this case I would use a definition list as so:

    <dl>
      <dt>Fruits I like:</dt>
      <dd>Apples</dd>
      <dd>Bananas</dd>
      <dd>Oranges</dd>
    </dl>
    
    0 讨论(0)
  • 2020-12-04 11:21

    I put the heading inside the ul. There's no rule that says UL must contain only LI elements.

    0 讨论(0)
提交回复
热议问题