Create an accessible dropdown navigation without JS

Content Warning: This blog post contains gifs. After cross-posting my last accessibility post about dropdowns on dev.to , I was reading through the comments and someone posted about :focus-within . The best thing about sharing my knowledge on the i…

Content Warning: This blog post contains gifs. After cross-posting my last accessibility post about dropdowns on dev.to , I was reading through the comments and someone posted about :focus-within . The best thing about sharing my knowledge on the internet is learning how other people are approaching things. Quite frankly, I have never used :focus-within before, so this is me learning and testing it out. Because this blog post will primarily be based on a continuation of the previous dropdown post , I highly suggest reading that beforehand if you haven't already. As a reminder, here is the same HTML structure from the previous post: What is :focus-within :focus-within takes the :focus pseudo-class a step further. It represents an element that receives focus or if one of its…
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: