Skip to content

Instantly share code, notes, and snippets.

@dvrajan
Created November 27, 2015 04:27
Show Gist options
  • Select an option

  • Save dvrajan/72410e3b80b6341d47b5 to your computer and use it in GitHub Desktop.

Select an option

Save dvrajan/72410e3b80b6341d47b5 to your computer and use it in GitHub Desktop.

Revisions

  1. dvrajan created this gist Nov 27, 2015.
    51 changes: 51 additions & 0 deletions Css FizzBuzz
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    <html>
    <head>
    <style>
    body{
    counter-reset: n;
    }

    div:before {
    counter-increment: n;
    content: counter(n);
    }

    div:nth-child(3n):before {
    content: "fizz";
    }

    div:nth-child(5n):before {
    content: "buzz";
    }

    div:nth-child(3n):nth-child(5n):before {
    content: "fizzbuzz";
    }
    </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>
    </body>
    </html>