DEV Community

Discussion on: Creating a Sidebar with HTML, CSS and JS

Collapse
 
felipperegazio profile image
Felippe Regazio • Edited

Definitely yes, but you cannot completely get rid of ARIA. I tried to give a vague introduction to that point at: "If you're thinking about accessibility (and you should), you'll maybe need the nav or the aside tag, depending on the way - and where - you're implementing your sidebar".

If you replace the root element (div) with a "nav" tag, you'll already gain a lot in accessibility considering the HTML5 semantics, etc. The aria-hidden will be optional in that context, but you will still need the aria-label, the @bourhaouta solution would be ok using a "nav". You can carefully consider the "aside" tag if your sidebar content its not related to the page main content.