Hope you enjoyed! If you have a word, phrase, or line you'd like to see as a Hangman game, leave it in the comments! Fandom terms, character names, iconic quotes, etc — anything goes, as long as I can make it work.
If you're curious how this works: HTML has a native element called details, which toggles open and closed when you click it. That's the only "interactivity" in this entire game. The trick is CSS :has(), a selector that lets a parent element react to the state of its children. So when you click a letter, its details opens, and CSS detects .hg:has(.gl-k[open]) and uses that to reveal the letter in the word display, update the wrong guesses list, draw the next part of the hangman figure, and check for a win or loss.
The figure itself is built from span elements set to visibility:hidden by default. Each wrong guess reveals the next body part. The "can't click a used letter" effect works by hiding the details element once it's open (but keeping it in the DOM so its state is preserved), and showing a plain greyed-out span in its place. The game-over lock is a transparent absolutely-positioned div that covers the keyboard the moment the win or lose condition is met.
I'll be posting a new Hangman game weekly! Now that I’ve built my own personal web app/generator to generate the entire HTML/CSS with right/wrong letters and difficulty after I input a word or phrase, each new game takes me less than five minutes to create. Which means this chaotic little HTML experiment has officially evolved yet again, and I can keep feeding it your fandom terms, iconic quotes, and increasingly unhinged suggestions.
---
If this moved you, even a little, please consider leaving a kudos or some feedback. I’ve poured a lot of time, love, and late-night tinkering into this. It's part of a new fixation, and I would love to hear everyone's thoughts.
Lately, I’ve realized: I have free will. Which means I’ve been joyfully and chaotically experimenting with HTML formatting and custom workskins.
Please stay tuned for the next HTML piece! I will post/update something in this series weekly OR biweekly; if you want to stay updated on this HTML series, please consider subscribing or bookmarking.
You can find me on Bluesky ( @the_wild_poet25 ) and on Twitter (the_tamed_poet) if you want to connect. I'm also on Discord too!
The comment section also works—feel free to leave a comment! :)