【发布时间】:2015-10-29 20:21:58
【问题描述】:
我正在使用 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>元素放入<main>元素中,而您拥有的代码是<aside>在父<section>内的代码 -
我已经更新了标题,感谢发现。
标签: html accessibility wai-aria