Member-only story
Featured
Popups with Pure HTML and CSS
Using the magic of the <dialog> tag
Ah, we are back at it again, with our goal to make everything with pure CSS and HTML. I once again ask the same question:
How far can we go with just HTML and CSS?
I’ve done dropdowns and InPageTabs before. This time, I’m exploring popups — modals, dialogs, overlays. Can we do those too, the pure HTML/CSS way?
Turns out, YES (almost)!
Once again, I’m extending AltCSS, and I needed a lightweight, no-JavaScript solution for popups. That meant digging into the native <dialog>
element. And what I found was pretty awesome.
In this post, I’ll show you how to build functional, accessible popup dialogs using only HTML and CSS — no bloated JS, no frameworks.
Not a medium member? Read for free via my friend link!
🚧 What We’ll Cover
✅ The built-in <dialog>
element and how it works.
🛠️ A minimal popup example using just HTML.
🧠 Deep dive into dialog’s native behavior and features.
🎨 How to enhance it with pure CSS.