HTML5 section tag meanings?

前端 未结 4 1843
广开言路
广开言路 2020-12-17 15:21

I know there are tons of questions about this topic but I can\'t find an authoritative source for the answer.

This is the official definition and th

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 15:58

    and
    are both sectioning content. You can nest one sectioning element inside another to slice up the outer element into sections.

    HTML Living Standard, 4.4.11:

    ... Sectioning content elements are always considered subsections of their nearest ancestor sectioning root or their nearest ancestor element of sectioning content, whichever is nearest, regardless of what implied sections other headings may have created. ...

    You can consider a

    as a generic sectioning element. It's like a
    that defines a section within its closest sectioning parent (or the nearest sectioning root, which may be the ).

    An

    is also a section, but it does have some semantics. Namely, it represents content that is self-contained (that is, it could possibly be its own page and it'd still make sense).

提交回复
热议问题