2022-06-29 Programming

How did I not know about this?! Turns out there's a CSS pseudo-class called :target, that always matches at most one element: whatever document fragment is currently pointed at in the URL. Which means you can have links pointing at parts of the page <a href="#there">like so</a>, and only have the element with id="there" be visible, while all its siblings are not, with only a two-line stylesheet:

	main article { Display: none; }
	main article:target { Display: block; }

What can you do with it? Why, stateless CYOA, of course! In other words, [[Ramus?]] lite. Which is exactly what I'm calling it for now.

Stay tuned for details; meanwhile, many thanks to Snail Legs for enlightening me.