Learn CSS By Playing Games 👾
Tags: beginners, css, tutorial, webdev
Published: 2021-05-28 11:14:27

<p><span class='first-letter'>L</span>earning CSS can be a frustrating experience sometime. One of the best things about learning to code is that people who are good at coding also happen to have the skills to make games that teach other people to code.</p>

Here are some games which help you to master CSS.

### 1. <a href="http://flexboxfroggy.com/">Flexbox Froggy</a>

<img src="https://i.imgur.com/GWrtvGq.jpg" alt="Flex box froggy" />

This game is about <mark>Flexbox</mark> and it covers flex properties like `align-items`, `justify-content`, `align-content`, `flex-direction`, `align-self`, `flex-wrap`, `flex-flow` and order in 24 different levels. 

Yeah, last level is bit challenging  😉

### 2. <a href="https://mastery.games/flexboxzombies/">Flexbox Zombies</a> 

<img src="https://i.imgur.com/O8cIaZn.jpg" alt="FlexBox Zombies" />

Here we use Flexbox to position the hero’s crossbow and hit the zombies and survive along the game.
Each section unravels part of the plot, gives you expertise over a new flexbox concept, and presents zombie survival challenges that force you to solidify your new skills like your life depends on it.

### 3. <a href="http://www.flexboxdefense.com/">Flexbox defense</a>

<img src="https://i.imgur.com/qi8yDrT.jpg" alt="flexbox-defence" />

Flexbox defense is based on the classic tower defence games, but to place our items we write CSS instructions. We use the justify-content property on the main container to move the single towers into effective positions.

### 4. <a href="https://cssgridgarden.com/">Grid Garden</a>

<img src="https://i.imgur.com/zeffn3Q.jpg" alt="Grid garden" />

Grid Garden game features 28 levels, starting with easy difficulty and gradually increasing it. Use the various grid properties to water and grow your carrot garden. Grid Garden has a code editor and visual area so you instantly see your result.


### 5. <a href="https://cssbattle.dev/">CSS Battle</a>

<img src="https://i.imgur.com/Y4p1koK.png" alt="CSS battle" />

CSS Battle is more of an online challenge than an actual CSS practice game, the objective is to write HTML and CSS code to replicate the given target image in the least code possible. This game is constantly updated with new challenges. It has a global ranking system and the ability to re-play each challenge so you can improve your own results.

### 6. <a href="https://flukeout.github.io/">CSS Diner</a>

<img src="https://i.imgur.com/Q4gpwIi.jpg" alt="CSS Diner" />

The CSS Diner webapp is really fun and genuinely educational for developers of all skill levels. You’ll go through 26 different levels of increasing difficulty. The first few levels teach core fundamentals like element selectors and class selectors. In the later levels you’re working with advanced concepts like :only-of-type and :not(x).

### 7. <a href="https://codepip.com/">CodePip</a>

<img src="https://i.imgur.com/UNmPh6x.png" alt="Code pip" />

We already checked Grid Garden and Flexbox Froggy, you’ve seen some examples of CodePip’s work already.
Those are just the two free games they offer. If you sign up for a pro account on their site, they also have games that range from general CSS review to JavaScript.

### 8. <a href="https://www.playcodemonkey.com/">CodeMonkey</a>

<img src="https://i.imgur.com/RiDdi9j.png" alt="Code monkey" />

CodeMonkey teaches coding using CoffeeScript, a real programming language, to teach you to build your own games in HTML5. It’s aimed at coding for kids, but it’s definitely fun for adults, too.

### 9. <a href="https://www.codingame.com/start">CodinGame</a>

<img src="https://i.imgur.com/VPE7X9E.png" alt="Coding Game" />

CodinGame offers up fun free games to help learn more than 25 programming languages, including JavaScript, Ruby, and PHP. One of the great things about CodinGame is that you can play with friends or colleagues, and also enter international coding competitions.

### 10. <a href="https://codecombat.com/">CodeCombat</a>

<img src="https://i.imgur.com/WdknSPK.png" alt="Code combat" />

Learn Python, JavaScript, CoffeeScript, or the Lua game scripting language. On the beginner Dungeon level, you’ll move your Hero through the game using some basic commands according to the tutorial alongside the game.

## Games using pure CSS 🔖

### 1. <a href="http://victordarras.fr/cssgame">Roadmap</a>

<img src="https://i.imgur.com/m5JJsR7.png" alt="Roadmap" />

Skill and speed are required to solve this little game, only made with CSS and HTML. It is not directly teaching CSS, but looking into the source code teaches a lot about clip-path, transform and animation with @keyframes!

### 2. <a href="https://codepen.io/una/pen/NxZaNr">Carnival</a>

<img src="https://i.imgur.com/YC1TEbp.png" alt="Carnival" />

You only have 8 seconds to hit all targets! A nice little CSS game using checkboxes and CSS animations.

### 3. <a href="https://serviceworkies.com">Service Workies</a>

<img src="https://i.imgur.com/9nBP8Oe.png" alt="Service workies" />

In this adventure you'll learn how to avoid the PWA pitfalls. You'll level up your skills and thrive with Service Workers. Perhaps even slay the savage beasts that have plagued the poor village workies for centuries! A registration is required.

### 4. <a href="https://rupl.github.io/unfold/">Unfold</a>

<img src="https://i.imgur.com/UazaTSl.png" alt="Unfold" />

This isn't exactly a game but more an interactive presentation about CSS 3D Transforms. Give it a go, it not boring 😂, animations are really awesome which has been done by pure CSS.


## Paid Games 🤑

### <a href="https://gridcritters.com">Grid Critters</a>

<img src="https://i.imgur.com/xH0phte.png" alt="Grid cutters" />

Your journey to master CSS Grid begins on the mysterious planet Grideros. Your mission is to use your ship's powerful Grid tool to save alien critters from extinction. A registration is required.

<table>
  <tbody>
    <tr>
      <td>
        🌟 <a href="https://twitter.com/suprabhasupi"> Twitter</a>
      </td>
      <td>
        👩🏻‍💻 <a href="https://www.suprabha.me/"> suprabha.me</a>
      </td>
<td>
        🌟 <a href="https://www.instagram.com/suprabhasupi/"> Instagram</a>
      </td>
    </tr>
  </tbody>
</table>