<分区>
我正在使用 main
标签 - 我应该将页眉和页脚标签放在 main 标签内还是应该分开?
还有,main标签需要role="main"吗?
标签 html
<分区>
我正在使用 main
标签 - 我应该将页眉和页脚标签放在 main 标签内还是应该分开?
还有,main标签需要role="main"吗?
最佳答案
来自 HTML5doctor 文章 The main element @Gaby 又名 G. Petrioli
经验法则:
<main>
每页;<main>
中.The primary purpose of <main> is to map ARIA’s landmark role main** to an element in HTML. This will help screen readers and other assistive technologies understand where the main content begins. The W3C spec describes as representing:
The main content area consists of content that is directly related to or expands upon the central topic of a document or central functionality of an application.
Exclude site's header/footer/menu :
excludes content that is repeated across a set of documents such as site navigation links, copyright information, site logos and banners and search forms (unless the document or applications main function is that of a search form).
role='main'
但作为本文的旁注,Steve Faulkner 写道:
You should still use the ARIA role until all browsers map the role to the <main> element.
关于html - 页眉和页脚标签是否应该在主标签内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20470345/
相关文章:
html - 在 CSS 的 ID 末尾使用奇数/偶数定位 div
javascript - Jquery 比较选中的数据/对象差异
html - 用户代理应该如何处理 tabindex 和 z-index 的非整数值?
javascript - 函数未在 google script HTML 服务中执行
html - 为什么将 float 与 % 一起使用时 div 会消失?
CSS 不兼容 : Nivo Slider Pushes Elements of Page Awry
javascript - 无法通过 jquery 附加 HTML 文件
javascript - 带有 forEach 函数的 querySelectorAll 不适用于旋转木马幻灯片上的切换按钮