This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
We are using the <summary> and <details> elements to get the expand/collapsable polyfill. The <summary> sometimes acts as the heading for the <details> for example a question and an answer section. My question is why isn't a heading allowed in the summary if it makes sense to give it structure: http://www.w3.org/TR/WCAG20-TECHS/H42 Current: <details> <summary>Why can't I add a h2 here?</summary> <p>…</p> </details> Proposed: <details> <summary><h2>Why can't I add a h2 here?</h2></summary> <p>…</p> </details>
I realize that doesn't work structurally. So maybe something like: <details> <h2><summary>Why can't I add a h2 here?</summary></h2> <p>…</p> </details>
(In reply to rubinahaddad from comment #0) > We are using the <summary> and <details> elements to get the > expand/collapsable polyfill. The <summary> sometimes acts as the heading > for the <details> for example a question and an answer section. My question > is why isn't a heading allowed in the summary if it makes sense to give it > structure: http://www.w3.org/TR/WCAG20-TECHS/H42 > > Current: > > <details> > <summary>Why can't I add a h2 here?</summary> > <p>…</p> > </details> > > Proposed: > <details> > <summary><h2>Why can't I add a h2 here?</h2></summary> > <p>…</p> > </details> THe summary element can contain: Either: phrasing content. Or: one element of heading content. http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-summary-element so you can do > Proposed: > <details> > <summary><h2>Why can't I add a h2 here?</h2></summary> > <p>…</p> > </details>