Last active
July 5, 2022 13:59
-
-
Save andrew8088/2769279183948faa6433168a296e87af to your computer and use it in GitHub Desktop.
FizzBuzz in CSS! Meant to style a bunch of sibling <div>s.
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
div { | |
counter-increment: fizzbuzz; | |
} | |
div::before { | |
content: counter(fizzbuzz); | |
} | |
div:nth-of-type(3n)::before { | |
content: 'fizz'; | |
} | |
div:nth-of-type(5n)::before { | |
content: 'buzz'; | |
} | |
div:nth-of-type(15n)::before { | |
content: 'fizzbuzz'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment