tubeshowcase●1,670,700 videosβ™‘ My collection 0
← Learn to Code

Learn to Code31:47

Why you shouldn't use a div for everything - creating accessible buttons and navigations

Kevin Powell β†—

From the creator

I think it's important to highlight when we've made past mistakes and show the right way to do it when we find those mistakes. πŸ”— Links βœ… The finished code: https://codepen.io/kevinpowell/pen/BaVdrLm βœ… More on Visually Hidden: https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html πŸ“š Resources I used to help make this video: βœ… AcceDe Web Accessibility Guidelines: https://www.accede-web.com/en/guidelines/rich-interface-components/hamburger-menu/ βœ… Paul J Adam's Accessible Hamburger Menu: https://pauljadam.com/demos/hamburger-menu.html βœ… Ally Style Guide's Mobile Navigation: https://a11y-style-guide.com/style-guide/section-navigation.html#kssref-navigation-navigation-mobile βœ… Building Accessible Menu Systems on Smashing Magazine: https://www.smashingmagazine.com/2017/11/building-accessible-menu-systems/#navigation-menu-buttons ⌚ Timestamps 00:00 - Introduction 00:29 - The mistake I made 01:18 - Why divs don’t make good buttons 03:10 - Fixing the styling of the button 03:48 - The second big mistake 05:20 - Adding extra context to our button 09:27 - Fixing up the CSS 10:47 - Updating the original jQuery to JavaScript 12:03 - Adding the aria-expanded to the JS 13:20 -

Published 2022-12-01 Β· Watch on YouTube β†—
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code