My take on a link to a random post with only HTML/CSS 0 ▲ Kilian Valkhof 8 hours ago · Tech · hide · 0 comments Chris Coyier recently posted about creating a “random post” link on a site that would link to a different URL using only HTML/CSS: A Button That Links to a Random Post in HTML & CSS Only . Here’s my take on that. I saw that article and it reminded me of one of the random() examples I made, a poem where I toggle between discrete values using if(). So I shot off this post but as I was about to go on holiday, I left it at that: This article is pretty fun. I'd solve it with a bunch of stacked links, then have a registered custom property that uses random() to set an int between 0 and number-of-links, then use that in an if() function to display:block one link (matching the randomly chosen int) master.dev/blog/a-butto… [image or embed] — Kilian Valkhof (@kilianvalkhof.com) July 30, 2026 at 3:49 PM Well, I’m back now and I figured I’d do something with this blog again and show you my implementation! It is very similar to the poem example I mentioned earlier, but uses sibling-index() and… No comments yet. Log in to reply on the Fediverse. Comments will appear here.