Should have or should have ?

前端 未结 3 414
陌清茗
陌清茗 2021-02-04 14:32

I\'m reading Mark Pilgirm\'s \"Dive into HTML5\" and in the semantics section, it talks about how HTML5 introduces the

and
3条回答
  •  一整个雨季
    2021-02-04 14:52

    It's entirely acceptable to nest them either way. Although the document outline does not distinguish between a

    and an
    , from a semantic point of view they are two different things. That's the whole point of introducing them as two distinct semantic elements.

    Use the first snippet if your page consists of multiple articles.

    Use the second snippet when you have an article that's comprehensive enough to contain multiple sections.

    You can even combine them both if using both fits your content, such that your markup looks like this:

    section article?

    art 1

    sec 1.1

    sec 1.2

    sec 1.3

    art 2

    sec 2.1

    sec 2.2

    sec 2.3

    art 3

    sec 3.1

    sec 3.2

    sec 3.3

提交回复
热议问题