Why you shouldn't use a div for everything - creating accessible buttons and navigations
Channel: Kevin Powell
Date: 2022-12-01

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 - Making improvements to the JS
18:38 - The next problem - removing the menu when it’s closed
19:31 - Why it’s important to do all this
20:49 - Toggling the display of the ul
23:29 - Fixing the animation

#css

--

Come hang out with other dev's in my Discord Community
💬 https://discord.gg/nTYCvrK

Keep up to date with everything I'm up to
✉ https://www.kevinpowell.co/newsletter

Come hang out with me live every Monday on Twitch!
📺 https://www.twitch.tv/kevinpowellcss

---

Help support my channel
👨‍🎓 Get a course: https://www.kevinpowell.co/courses
👕 Buy a shirt: https://teespring.com/stores/making-the-internet-awesome
💖 Support me on Patreon: https://www.patreon.com/kevinpowell

---

My editor: VS Code - https://code.visualstudio.com/

---

I'm on some other places on the internet too!

If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.

Twitter: https://twitter.com/KevinJPowell
Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell

---

And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!