4 Matching Annotations
  1. Feb 2021
    1. Using details/summary for dropdown nav menu without requiring any JavaScript

    2. in this post, we’ll look at how to use this as the basis for an accessible dropdown navigation element that can be opened equally well by keyboard users tabbing through the page, and mouse users hovering on the nav item
    3. The HTML details element comes with a surprise – in most browsers it has the ability to hide and show content with no additional JavaScript or CSS whatsoever. Here’s a little bit about how it works. details has with a child called summary, and when a page first loads, the summary is the only part of the element that’s visible, along with a triangle that browsers display by default, to suggest the expandable nature of the content. Interacting with the summary element, by clicking or using the keyboard, will make the rest of the details element visible and add an open attribute to the details element itself.
  2. Sep 2020