我正在使用HTML5和WAI-ARIA来改进HTML中的可访问性。
可以进行以下设置吗?
- <!-- main content -->
- <section id="main" role="main">
- <h1>The main content</h1>
- <!-- This div needs to be here for styling reasons -->
- <div class="the-content">
- <p>All the text that goes with the main content</p>
- </div>
- <!-- the sidebar -->
- <aside id="sidebar" role="complementary">
- <h2>A title</h2>
- <p>Some text</p>
- <aside>
- </section>
我不知道的是,如果我应该有< aside> < section>之外的元素和role =“main”容器。这很重要吗
解决方法
没关系是的。在哪里放置它是由aside标签中的内容与主要部分的关系来定义的。
例如:
如果内容与主要文章有关,则应在主要内容之内。但是,如果侧边栏旁边标签的内容与主要不同,我将把它放在主要部分之外
http://html5doctor.com/aside-revisited/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside