Re: HTML5.1 Details Tag for a Offcanvas menu - Is my code semantically correct?

Looks fine to me, details element can include any elements listed as flow
content
https://w3c.github.io/html/dom.html#flow-content

On Sunday, 20 November 2016, Michael Hacker <info@superbox.one> wrote:

> I have an idea for implementing an offcanvas menu which works without
> JavaScript.
>
> This is the HTML code:
>
> <a href="#offcanvas_menu">Menu</a>
>
> <nav id="offcanvas_menu">
>     <ul>
>         <li>
>             <a chref="..">Menuitem 1</a>
>         </li>
>         <li>
>             <details>
>                 <summary>Menuitem 2</summary>
>                 <ul>
>                     <li>
>                         <a class="first_menuitem"
> href="/manage/users/">Sub Menuitem 1</a>
>                     </li>
>                  </ul>
>              </details>
>          </li>
>      </ul>
> </nav>
>
> The menu is oopen with offcanvas_menu:target { }
> The Sub menu is open with the new details tag. It's work without
> JavaScript :)
>
> My question is. Is this also semantically correct?
>
> The HTML5.1 Spec says:      "The details element represents a disclosure
> widget from which the user can obtain additional information or controls."
> A navigation is a form of control.



-- 
--

Regards

SteveF
Current Standards Work @W3C
<http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>

Received on Monday, 21 November 2016 09:01:08 UTC