Created
January 17, 2013 14:55
-
-
Save robertc/4556455 to your computer and use it in GitHub Desktop.
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> | |
<html lang="en"> | |
<head> | |
<title>FizzBuzz CSS Version</title> | |
<style type="text/css"> | |
table { | |
counter-reset: number; | |
} | |
tr td:before { | |
counter-increment: number; | |
content: counter(number); | |
} | |
tr:nth-child(3n) td:before { | |
content: "Fizz"; | |
} | |
tr:nth-child(5n) td:before { | |
content: "Buzz"; | |
} | |
tr:nth-child(3n):nth-child(5n) td:before { | |
content: "FizzBuzz"; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>FizzBuzz implemented with CSS generated content and nth child selectors</h1> | |
<p>Known to work in Firefox 3.5, Safari 4.0, Opera 10.10 and Chrome 4.0.</p> | |
<table> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
</tr> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment