Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
There's no JavaScript or markup content :)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>FuzzBuzz with CSS</title>
<style type="text/css">
body{counter-reset:fuzzbuzz;font-family:arial;font-size:18px;}
div{padding:10px;margin:10px;width:80px;float:left;height:30px;color:#999;text-align:center;}
div:after{content:counter(fuzzbuzz);counter-increment:fuzzbuzz;}
div:nth-child(3n):not(:nth-child(5n)):after{content:"fuzz";color:red;font-weight:bold;}
div:nth-child(5n):not(:nth-child(3n)):after{content:"buzz";color:blue;font-weight:bold;}
div:nth-child(3n):nth-child(5n):after{content:"fuzzbuzz";color:purple;font-weight:bold;}
</style>
</head>
<body>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
</body>
</html>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment