We have a details and summary element, which contains some div elements, like so:
<details open>
<summary>Some summary</summary>
<div>This content is display</div>
<div class="hidden">This content is NOT displayed</div>
</details>
I have 2 questions that I'm struggling to find the answers to online:
Is it "okay" / correct to hide child elements of an open details element. In the example, you'll see the the 2nd element is hidden, using
display: none.Should
detailsonly have 1 child element, besides thesummaryelement? On https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element, it does state the following:Content model: One summary element followed by flow content.
And flow content is defined by the following: https://html.spec.whatwg.org/multipage/dom.html#flow-content
But I'm not sure if that means I'm allowed multiple flow content's.