【发布时间】:2011-09-27 16:08:26
【问题描述】:
details 元素在语义上是否适合标记手风琴?
例子:
<div class="accordion">
<details open>
<summary>Section 1</summary>
</details>
<details>
<summary>Section 2</summary>
</details>
<details>
<summary>Section 3</summary>
</details>
</div>
我问这个问题是因为规范对它的用法不是很清楚。它只是说明 details 元素是一个披露小部件。 我当然不想将元素用于不应该的东西。
编辑
这样的东西在语义上会更适合吗?
<article role="tablist">
<header role="tab" aria-expanded>Section 1</header>
<div role="tabpanel">
</div>
<header role="tab">Section 2</header>
<div role="tabpanel">
</div>
<header role="tab">Section 3</header>
<div role="tabpanel">
</div>
</article>
谢谢!
【问题讨论】:
标签: html accordion semantics details-tag