Collection of free HTML and pure CSS game code examples from Codepen and other resources
Explore a collection of free HTML and pure CSS game code examples from Codepen and other resources to create fun and interactive games for your website.

CSS Only Retro Dungeon Maze Puzzle
Takane Ichinose | September 28, 2021
HTML (Pug) / CSS (SCSS)
About a code
This is a simple maze or dungeon escape game, with its functionality made entirely in CSS. The main goal of this game is to of course find the finish line. The main rule of this game is to click the horizontal or vertical tile beside the character. You may not click diagonally.
Chrome, Edge, Firefox, Opera, Safari
no
-

NES Duck Hunt game in CSS
Hai Le | April 25, 2021
HTML (Pug) / CSS (Less)
About a code
This is a remake of the classic NES game duck hunt in CSS, it is made up entirely of HTML and CSS, no images are used.
Chrome, Edge, Firefox, Opera, Safari
yes
-

Plankman
Alvaro Montoro | August 4, 2020
HTML / CSS
About a code
Plankman is a pirate-themed version of the classic hangman game. It is developed using HTML and CSS without a single line of code.
Chrome, Edge, Firefox, Opera, Safari
yes
-

The Mine: No JS, CSS Only Adventure Game
Jamie Coulter | October 19, 2018
HTML (Haml) / CSS (SCSS)
About a code
The logic behind it is actually relatively simple and uses a 7+ year old technique. By clicking on an arrow (in this case a label), it checks the relevant input and then using the :checked
pseudo selector, we can traverse down the DOM the correct amount of iterations and shift the entire viewport a whole 'segment' over. The lifts work entirely the same way except instead when we click down, we are actually checking the segment below.
Chrome, Edge, Firefox, Opera, Safari
no
-

Pure CSS Ghost Bustin' game with CSS Variables
Jhey | October 6, 2018
HTML (Pug) / CSS (Stylus)
About a code
A pure CSS game. A "whack-a-mole" type game where you bust ghosts by tapping them. It leverages checkbox tricks and the use of counter-increment
to keep score. It also leverages CSS variables to assign scores to ghosts along with their speed and delay. Finally, it's wrapped in a form so we can reset everything with a type='reset'
at the end.
Chrome, Edge, Firefox, Opera, Safari
yes
-
Discover Our Extensive Snippet Library
This heading suggests that your website provides a wide variety of snippets across different technologies, encouraging users to explore and use these resources for their development projects.
HTML Snippets.
Explore a collection of HTML snippets designed to streamline your web development process. From basic structures to complex elements.
CSS Snippets.
Discover powerful CSS snippets that help you style your web pages with ease. Whether you need layout solutions, animations
JavaScript Snippets.
Enhance your website's interactivity with our JavaScript snippets. From DOM manipulation to advanced algorithms
Bootstrap Snippets.
Leverage the power of Bootstrap with our collection of snippets. Quickly integrate responsive design components
Tailwind Snippets.
Speed up your development process with Tailwind CSS snippets. These utility-first CSS snippets enable you to
jQuery Snippets.
Simplify your JavaScript development with jQuery snippets. Easily perform common tasks like event handling, animations
Let's craft a visual identity that ignites passion and loyalty. ✨