topskill.dev
CoursesTracks
0
All courses/CSSLantern Market navigation
Project - Dropdown Menu
2 / 3
← CSS
○CSS Rule Style an Exhibit Card○Write Your First CSS Rule○CSS Selectors Target Exhibit Details○Target Exhibit Details○Apply CSS Three Sources○Apply CSS Three Ways○Specificity Resolve a Style Conflict○Resolve Specificity○Inheritance and the cascade✦Module Quiz
○Color Palette○Color Palette○Background Layer○Background Layer○Type Rhythm○Type Rhythm○Borders and Shadows○Borders and Shadows✦Module Quiz
○Box Model Seed Packet Card○Space a Seed Packet○Display Swap Table Labels○Arrange Swap Table Labels○Positioning Pickup Pin○Pin the Pickup Location○Sizing and Overflow○Size a Seed-Swap Notice○Sticky scroll headings✦Module Quiz
○Advanced Selectors Book Cart Sign○Target a Book Cart Sign○Pseudo-Classes Night Cart States○Style Night Cart States○Pseudo-Elements○Add a Book-Quote Mark✦Module Quiz
○Lantern Market navigation●Lantern Market navigation✦Module Quiz
○Community garden request card○Community garden request card✦Module Quiz
○Flex Direction○Flex Direction○Main-Axis Spacing○Main-Axis Spacing○Cross-Axis Alignment○Cross-Axis Alignment○Wrapping and Flex Items○Wrapping and Flex Items○Flexbox Navigation○Flexbox Navigation✦Module Quiz
○Grid Tracks○Grid Tracks○Grid Gaps○Grid Gaps○Grid Placement○Grid Placement○Responsive Grid○Responsive Grid✦Module Quiz
○River radio schedule○Harbor radio schedule✦Module Quiz
○Field note color system○Field note color system○Transforms○Rotate a Field Note○Resilient styles✦Module Quiz
○Kite festival signal○Garden festival signal✦Module Quiz
○Garden forecast○Harbor forecast○Fluid sizing○Fluid weather bulletin○Images that fit✦Module Quiz
○Seed inventory table○Tool checkout table✦Module Quiz
○Community maker profile○Maker profile sheet✦Module Quiz

Lantern Market navigation

Style the directory disclosure

The supplied details and summary already toggle the directory. The links, positioning, and link-focus outlines are setup. Finish its closed/open presentation and the summary’s keyboard focus ring in style.css. Leave the HTML unchanged.

Use the open attribute rather than a hover-only rule: the same native toggle then works with a pointer, touch, Enter, and Space. Put your base hiding rule before the open-state rule.

Your Task

  1. Set .submenu to display: none as the closed-state rule.
  2. Set .menu-item[open] .submenu to display: block to reveal the expanded directory.
  3. Set .menu-trigger:focus-visible to outline: 3px solid #2563eb so the native summary has a visible keyboard focus ring.

Run and Submit after each change. Open Stalls and Tab through Tea counter and Paper goods, then return to Stalls and press Space to close it. The open directory stays open when the pointer leaves; this is a disclosure, not an ARIA application menu. Escape-to-close would need additional behavior later in the vanilla-DOM course.

Hint 1
1 / 2
HINT 1

Keep the stylesheet linked from the document head.

HINT 2

Change one declaration at a time, then use Run Preview to inspect the result.

Take the Quiz →
Files
  • ⋄index.html
  • ⋄style.css
Loading editor…