Created
October 28, 2013 19:32
-
-
Save jeremydw/7203097 to your computer and use it in GitHub Desktop.
FizzBuzz in CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>FizzBuzz in CSS</title> | |
<meta charset='utf-8'> | |
<style> | |
ul { | |
counter-reset: number; | |
} | |
li:before { | |
counter-increment: number; | |
content: counter(number); | |
} | |
li:nth-child(3n):before { | |
content: 'Fizz'; | |
} | |
li:nth-child(5n):before { | |
content: 'Buzz'; | |
} | |
li:nth-child(3n):nth-child(5n):before { | |
content: 'FizzBuzz'; | |
} | |
</style> | |
<ul> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
<li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment