Build modals in minutes with the dialog element
✉ Keep up to date with everything I'm up to https://www.kevinpowell.co/newsletter ✅ Video where I look at popover: https://www.youtube.com/watch?v=DNXEORSk4GU ✅ a11yproject on visually hidden: https://www.a11yproject.com/posts/how-to-hide-content/ ✅ Adrian’s article deailng with focus: https://adrianroselli.com/2025/06/where-to-put-focus-when-opening-a-modal-dialog.html 💬 Come hang out with other devs in my Discord Community https://discord.gg/nTYCvrK ⭐ Are you a beginner? HTML & CSS for absolute beginners is for you: https://learn.kevinpowell.co 🎓 Start writing CSS with confidence with CSS Demystified: [https://cssdemystified.com](https://cssdemystified.com/) 🚀 Already mastered CSS? Check out my advanced course, Beyond CSS: https://www.beyondcss.dev/ ⌚ Timestamps 00:00 - Introduction 00:45 - the basics of the dialog element 03:00 - opening the dialog with .show() and .showModal() 07:30 - adding a button to close the dialog 09:00 - dealing with autofocus 11:15 - make the close button a
Watch on Kevin Powell
Opens in a new tab




