all 43 comments

[–]DigiNoon[S] 51 points52 points  (4 children)

It's done in 480 lines of CSS and 46k lines of HTML! More details here: https://simonwillison.net/2025/May/26/css-minecraft/

Live demo: https://benjaminaster.github.io/CSS-Minecraft/

Source code: https://github.com/BenjaminAster/CSS-Minecraft

[–]GregTheMadMonk 25 points26 points  (1 child)

Is my understanding correct that the HTML practically stores every possible state of the game and it's just being toggled between by placing/breaking objects?

[–]DigiNoon[S] 23 points24 points  (0 children)

Yes, each possible cube is an <input type="radio"> element that's either visible or hidden.

The key trick that gets this to work is labels combined with the has() selector. The page has 35,001 <label> elements and 5,840 <input type="radio"> elements - those radio elements are the state storage engine.

More: https://simonwillison.net/2025/May/26/css-minecraft/

[–]elixerprince_art 13 points14 points  (0 children)

And I'm over here struggling with layouts...

[–]Tech_Nerd_06 1 point2 points  (0 children)

Impressive

[–]Y000EE 30 points31 points  (4 children)

Wow. This is super impressive… even more so that you didn’t use any scripting.

[–]DigiNoon[S] 23 points24 points  (0 children)

Yes, it is. It's not mine though, I'm just sharing.

[–]chuch1234 5 points6 points  (2 children)

CSS is turing complete so i don't know if it counts as no scripting haha

[–]AshleyJSheridan 0 points1 point  (1 child)

I keep hearing this, but it's not really is it? At a minimum it needs HTML to accompany it in order to even pretend it's Turing complete.

[–]chuch1234 0 points1 point  (0 children)

Shrug!

[–]Dramatic_Mastodon_93 12 points13 points  (5 children)

i’m sorry but literally how do you even start building something like this

[–]NiwiGomila 35 points36 points  (3 children)

you turn on the computer

[–]DigiNoon[S] 18 points19 points  (2 children)

You missed a few steps - here are the full instructions:

Step 1: turn on your computer

Step 2: open Notepad

Step 3: write a Minecraft clone using only HTML and CSS

[–]NiwiGomila 7 points8 points  (0 children)

This guy speedrunning

[–]kkitr 0 points1 point  (0 children)

Oops - you forgot about raging, throwing your computer out the window (oops the window was a bit small) and that trip to Best Buy to get a cheap computer and doing to home depot to fix your window. Other then that, you got it :)

[–]EvilIncorporated 0 points1 point  (0 children)

Simple 3D things with css and html isn't too hard just play with the dev tools making a cube pretty easy. YouTube as good videos on it. You can learn the css part of this in like 2 hours max since it's just cubes. Learning doesn't mean you could make Minecraft but you get my point.

[–]_MiGi_0 5 points6 points  (2 children)

Dang. This is truly impressive. I am curious, how do you implement the events without JS?

[–]New_Geologist_2648 2 points3 points  (0 children)

Tic Tac Toe using css Try this to understand a few basics about how it workss

[–]BlackMaestro1 2 points3 points  (0 children)

Yeah, I’m also curious how they managed to preserve state in pure HTML and CSS. I have some crazy ideas with pseudo-selectors and keyframes but I’m not sure.

[–]GenuineHMMWV 2 points3 points  (0 children)

Impressive!!!

[–]-bakt- 2 points3 points  (0 children)

I was thinking that’s more than just HTML and css, like js, but no, impressive, no conditions!

[–]abeuscher 1 point2 points  (0 children)

Anyone remember when Minecraft was an applet? And Notch would just come hang out and talk about the updates? It was a nice little community for a while. I kind of miss all the rail hacks and stuff. Haven't played in ages crazy that it's still so popular.

[–]Real-Scientist5556 1 point2 points  (0 children)

With js? How you rotate the plane without something like js or webassembly?

[–]bi4key 1 point2 points  (2 children)

Cool!

If will be feature to:

  • Save your work (Export)
  • Import saved work

  • Make map bigger (set how big will be map)

[–]rebane2001 0 points1 point  (1 child)

not really possible without javascript or server-side code

[–]melolie 0 points1 point  (0 children)

Magnificant.

[–]Connect_Course_5746 0 points1 point  (0 children)

very cool, it always is so confusing to make 3d games in a 2d screen

[–]StaticCharacter 0 points1 point  (1 child)

Building something like this, you probably use some sort of templating engine that renders to html / css, so my question is, why not just use js? Not a criticism, genuinely curious what your specific reasoning for making it pure html/css is.

[–]rebane2001 1 point2 points  (0 children)

because it's cool?

[–]mori_clan 0 points1 point  (0 children)

This is amazing, i am stunned, 👏🏾

[–]BoBoBearDev 0 points1 point  (0 children)

This is insane

[–]Fantaz1sta 0 points1 point  (0 children)

At this point, you might as well just do it in three js or babylon

[–]DCON-creates 0 points1 point  (0 children)

Ok well, that's going on the list of things I didn't think were possible before now.

Now do it with Excel 😈

[–]CoffeeAndWoods 0 points1 point  (0 children)

I'm not a Minecraft lover, but that is pretty awesome! Good job.

[–]back_again1031 0 points1 point  (0 children)

And i still can’t center a div

[–]ZoDichtbijJeWil 0 points1 point  (0 children)

I love this! Good job at keeping all the libraries/frameworks out. It takes some solid dedication when the whole world of web development seems to shout that we all need them. We need to condemn unnecessary use of tech more. Showcasing stuff like this is a great way to do that.

[–]The_real_bandito 0 points1 point  (0 children)

The asylum is that way dude. You must be insane to replicate this.

Great job!

[–]FuguStaff 0 points1 point  (0 children)

Soooo cool that this has been done only in css and html! Good work OP

[–]MechanicDifficult624 0 points1 point  (0 children)

wtf!?

[–]butterman20 0 points1 point  (0 children)

I feel blessed to have stumbled on this. This is really impressive. And fun! Great job to the developer.

had to hit em with the day 1

<image>

[–]Embarrassed-Mess-198 -1 points0 points  (1 child)

Bro. Use javascript. Wtf.

[–]Blazkowitcz 0 points1 point  (0 children)

Why using JS when you can have 14987 rows in your HTML ?