Multiple Headers and ARIA Roles

后端 未结 2 1176
感情败类
感情败类 2021-01-28 07:11

I have an HTML Structure which really has 2 headers: At the tippity top of the page it has some navigation items and buttons, below that is another section which holds the logo

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-28 07:46

    Yes, it makes sense to use header for both of these.

    As header has no influence on the document outline, it’s up to you use one or several header elements; it doesn’t affect the meaning. If there is no reason not to use one element (i.e., there is no content inbetween that should not be part of header), go with one element.

    The ARIA role main is for the main content of a page. Navigation is typically not the main content, unless it’s the only content and purpose of a page. However, in that case you wouldn’t use the header element, as its job is to "exclude" content that is not considered to be part of the main content.

提交回复
热议问题