- From: Michael Hacker <info@superbox.one>
- Date: Sun, 20 Nov 2016 15:51:32 +0100
- To: public-html-comments@w3.org
- Message-Id: <D9C6CFB2-6ADE-44AE-BCCE-14912E9579E3@superbox.one>
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.
Attachments
- application/pkcs7-signature attachment: smime.p7s
Received on Monday, 21 November 2016 08:51:02 UTC