DEV Community

Cover image for 8 Games to learn CSS the fun way
Andreas
Andreas

Posted on • Updated on

CSS Game 8 Games to learn CSS the fun way

I must admit, I have trouble remembering things. Especially when it comes to CSS. The Flexbox Layout for example. The property justify-content of a flex container can have more than 12 different values where many can be combined with the keywords safe or unsafe. To read the complete guide to flexbox on CSS Tricks, you have to scroll through a two column page with a height of more than 20k pixels - and although the title implies it, they are not covering everything.

I recently stumbled upon a tower defense game teaching flexbox, which really...
Wait, a what?
Yes, it turned out, that there are quite a lot of games out there, helping to teach CSS. I collected some free CSS games that were useful for me and maybe can help you have some fun with CSS again!

1. Flexbox Defense

CSS Game Flexbox Defense

I was just mentioning this game. It covers the flex properties align-items, justify-content, flex-direction, align-self and order in 12 different levels. Especially the last 4 levels are really fun and a little bit tricky.

2. Flexbox Froggy

CSS Game Flexbox Froggy

This game is also about Flexbox and it covers even more flex properties: align-items, justify-content, align-content, flex-direction, align-self, flex-wrap, flex-flow and order in 24 different levels. Drop a comment, if you solved the last level 😅.

3. Grid Garden

CSS Game Grid Garden

In 28 different levels you can learn CSS Grid Layout. It covers the following grid properties: grid-column-start, grid-column-end, grid-column, grid-row-start, grid-row-end, grid-row, grid-area, order, grid-template-columns, grid-template-rows and grid-template.

4. CSS Diner

CSS Game CSS Diner

This is a little game about all kinds of CSS selectors. Try to master all 32 levels to call yourself a CSS selector expert - and hungry 😋.

5. Unfold

CSS Interactive Presentation Unfold

This isn't exactly a game but more an interactive presentation about CSS 3D Transforms. You may think this is boring but trust me: The animations are 🔥 and you wouldn't think this is possible with pure CSS.

6. Roadmap

CSS Game 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!
Drop a comment how many attempts you needed to win - I needed 8! 😅

7. Carnival

CSS Game Carnival

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

8. Tic-Tac-Toe

CSS Game Tic-Tac-Toe

And at last a classic. Tic-Tac-Toe as pure CSS game with 2 levels of difficulty also using checkboxes and CSS animations.

Bonus

And here comes the bonus part with recommendations from the comments:

9. Flexbox Zombies

CSS Game Flexbox Zombies

This is a storyline driven training course where you learn to use Flexbox and a crossbow to hunt zombies. A registration is required.

10. Service Workies

CSS Game 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.

11. Grid Critters

CSS Game Grid Critters

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.

12. CSSBattle

CSS Game CSSBattle

In this online CSS Code Golfing game players from all around the world try to visually replicate "Targets" in smallest possible CSS code and battle it out to get to the top of the leaderboard.

Wrapping it up

Doesn't matter if you're a beginner or an expert - I hope you had fun playing some games and at the same time learning something about CSS! Especially on Codepen you can find a lot of awesome games people created just using HTML and CSS.

If you know other great CSS learning games, let everyone know in the comments below.


Edited: 2nd July 2021 (fix flexbox zombies link, add cssbattle)
Edited: 29th October 2019 (add 3 bonus games from Dave Geddes recommended in a comment)
Edited: 28th October 2019 (switch from wrong flexbox example justify-items to justify-content)
Originally published: 24th October 2019 on Medium

Latest comments (67)

Collapse
 
apkarctic profile image
apkarctic

Unique and informative article on this topic TikTok

Collapse
 
vupadhayayx86 profile image
vupadhayayx86

Only the last level was tricky, rest all level were easy-peasy!

Image description

Collapse
 
rasyidmp profile image
Halimur Rasyid MP

solved the last level of Flexbox Froggy,

flex-direction: column-reverse;
align-content: space-between;
justify-content: center;
flex-wrap: wrap-reverse;
Enter fullscreen mode Exit fullscreen mode
Collapse
 
zuccberg090 profile image
Zucc Berg

Two years back i started learning CSS, being a developer is very hectic. Then i start making games and change their features and sell my products to gaming websites. Recently, i sold updated vweion of Pubg Mobile. It was fun 😁😁

Collapse
 
dwarfstar099 profile image
Kumar Gourav

Yay! I solved the last Exercise. It was truly rewarding, helped me understand CSS Flexbox.

flex-flow: column-reverse wrap-reverse;
justify-content: center;
align-content: space-between; 
Enter fullscreen mode Exit fullscreen mode
Collapse
 
klisostom profile image
Klisostom

Flexbox Froggy (flexboxfroggy.com) - level 24:

flex-flow: column-reverse wrap-reverse;
align-items: flex-end;
justify-content: center;
align-content: space-between;

Collapse
 
dwarfstar099 profile image
Kumar Gourav

It will even work without
align-items: flex-end;

Collapse
 
jack13804 profile image
GroupsLinker

I love your WorkThanks for sharing.

Collapse
 
jonsonmlm87 profile image
Finance Mlm

If you want best video editor. then install Alight Motion.

Collapse
 
janes profile image
jane • Edited

thanks for sharing with us..
Beach Bootcamp

Collapse
 
techpoint4 profile image
limited supply

If you want all the latest version with free use then don't forget to visit here.

Collapse
 
pratik11939 profile image
Pratik11939

Dont forget to check Techtrickers

Collapse
 
pratik11939 profile image
Pratik11939

don't forget to check techtrickers.com

Collapse
 
janes profile image
jane • Edited

ok checking this. yoga hotels

Collapse
 
adnantanveer10 profile image
Adnan Tanveer

Check out this this android game: dapks.com/afk-arena-mod-apk/
I would like someone to let me know how this game would be created on kotlin.
Would really appreciate the help!

Collapse
 
apkmie profile image
Apkmie

check out this also Buy Tourmaline

Collapse
 
jord_91 profile image
jorden

Thanks i will check it after Magic Mushroom Retreat

Collapse
 
trafalgarlaw profile image
Roshan Khausiya

Great article I played them and enjoyed started coding too anyway
and dont forget to check Thehimalayantime

Collapse
 
haris_virk_2aa9f18a04921b profile image
Haris Virk • Edited

Thanks for sharing a beautiful piece of information. All CCS games are great and lots of fun, Feel free to check thexploretech.com/free-sports-stre...

Collapse
 
jord_91 profile image
jorden

thanks will check about restore and renew

Collapse
 
devmount profile image
Andreas

You're welcome.

Collapse
 
elijahlynn profile image
Elijah Lynn • Edited

Flexbox Zombies link is broken/404. Here is working link, and it is still free fwiw > flexboxzombies.com/ > mastery.games/flexboxzombies/.

Collapse
 
devmount profile image
Andreas

Good catch, thank you for this hint! I fixed it 🔨👍🏻

Some comments may only be visible to logged-in visitors. Sign in to view all comments.