correct semantics for ul in ul

后端 未结 6 506
自闭症患者
自闭症患者 2020-11-28 12:03

I am writing ul inside ul to make a accordion type of menu. But when I check my code below in html validator it gives me these errors



        
6条回答
  •  粉色の甜心
    2020-11-28 12:33

    This took me a little while to understand because I wrapped my inner ul in its own li tag and not within the li tag that my inner ul was attached to. If you wrap your inner ul in its own li tag you'll get an additional unneeded bullet.

    • Item 1
    • Item 2
    • item 3
    • Item 4
    • Item 5 has sub items:
      • Sub Item 1
      • Sub Item 2
    • Item 6
    • Item 7

提交回复
热议问题