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.

A Pure CSS Table Tennis Game

A Pure CSS Table Tennis Game

Author:
Ben Evans | April 19, 2023
Made with:
HTML / CSS (SCSS)

About a code

No images. No JavaScript. Only CSS. And a few HTML radio inputs.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Can Connect 4?

Can Connect 4?

Author:
Jhey | October 6, 2022
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
yes
Dependencies:
-
CSS Only Puzzle Game

CSS Only Puzzle Game

Author:
Temani Afif | August 29, 2022
Made with:
HTML (Pug) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Pure CSS Mine Sweeper

Pure CSS Mine Sweeper

Author:
Samridhi | September 19, 2021
Made with:
HTML (Haml) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
CSS Only Retro Dungeon Maze Puzzle

CSS Only Retro Dungeon Maze Puzzle

Author:
Takane Ichinose | September 28, 2021
Made with:
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.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Play CSS Space Invaders

Play CSS Space Invaders

Author:
Jon Slater | June 2, 2021
Made with:
HTML / CSS

About a code

A reasonably complete version of Space Invaders, using only CSS, Includes a high score table.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
NES Duck Hunt game in CSS

NES Duck Hunt game in CSS

Author:
Hai Le | April 25, 2021
Made with:
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.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Pure CSS/SVG Tic Tac Toe

Pure CSS/SVG Tic Tac Toe

Author:
Jhey | January 30, 2021
Made with:
HTML (Pug) / CSS (Stylus)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Pure CSS Whac-A-Mole

Pure CSS Whac-A-Mole

Author:
Deep Toaster | December 21, 2020
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
The Caretaker - A Pure CSS Horror/Puzzle Game

The Caretaker - A Pure CSS Horror/Puzzle Game

Author:
Jamie Coulter | October 27, 2020
Made with:
HTML (Haml) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
A Pure CSS Game - You Must Build a Lighthouse

A Pure CSS Game - You Must Build a Lighthouse

Author:
Ben Evans | October 22, 2020
Made with:
HTML / CSS (SCSS)

About a code

100% CSS. No artificial colours or ingredients.

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
no
Dependencies:
-
Plankman

Plankman

Author:
Alvaro Montoro | August 4, 2020
Made with:
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.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
CSS Rock-Paper-Scissors

CSS Rock-Paper-Scissors

Author:
Alvaro Montoro | October 3, 2019
Made with:
HTML / CSS

About a code

A Rock-Paper-Scissor game developed in HTML+CSS without any JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
CSS Tic-Tac-Toe

CSS Tic-Tac-Toe

Author:
Alvaro Montoro | May 25, 2019
Made with:
HTML / CSS

About a code

Tic-Tac-Toe game developed using only HTML and CSS, without any JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
The Mine: No JS, CSS Only Adventure Game

The Mine: No JS, CSS Only Adventure Game

Author:
Jamie Coulter | October 19, 2018
Made with:
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.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Pure CSS Ghost Bustin' game with CSS Variables

Pure CSS Ghost Bustin' game with CSS Variables

Author:
Jhey | October 6, 2018
Made with:
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.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Pure CSS Game: Stacker

Pure CSS Game: Stacker

Author:
Jerry Low | January 29, 2018
Made with:
HTML (Slim) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Pure CSS Carnival Game

Pure CSS Carnival Game

Author:
Una Kravets | February 22, 2016
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Pure CSS Tic-Tac-Toe

Pure CSS Tic-Tac-Toe

Author:
Žiga Miklič | August 11, 2014
Made with:
HTML (Pug) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
font-awesome.css

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

React Snippets.

Build robust, component-based user interfaces with our React snippets. From state management to lifecycle methods,

Vue Snippets.

Streamline Vue.js development with our collection of snippets for creating components, managing state, and handling events.

Ready to set your Brand ablaze?

Let's craft a visual identity that ignites passion and loyalty. ✨