{"id":490,"date":"2016-10-21T23:06:49","date_gmt":"2016-10-22T04:06:49","guid":{"rendered":"http:\/\/www.marcblase.com\/blog\/?p=490"},"modified":"2016-10-21T23:06:49","modified_gmt":"2016-10-22T04:06:49","slug":"css-fizzbuzz","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2016\/10\/css-fizzbuzz\/","title":{"rendered":"CSS FizzBuzz"},"content":{"rendered":"<p>Saw this recently on twitter and am placing it here for posterity&#8217;s sake.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Fizz Buzz via CSS&lt;\/title&gt;\r\n&lt;style&gt;\r\nbody {\r\n\tcounter-reset:n;\r\n}\r\ndiv:before {\r\n\tcounter-increment:n;\r\n\tcontent: counter(n);\r\n}\r\ndiv:nth-child(3n):before {\r\n\tcontent:&quot;fizz&quot;;\r\n}\r\ndiv:nth-child(5n):before {\r\n\tcontent:&quot;buzz&quot;;\r\n}\r\ndiv:nth-child(3n):nth-child(5n):before {\r\n\tcontent:&quot;fizzbuzz&quot;;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div&gt;&lt;\/div&gt;\r\n&lt;div&gt;&lt;\/div&gt;\r\n&lt;div&gt;&lt;\/div&gt;\r\n&lt;div&gt;&lt;\/div&gt;\r\n&lt;div&gt;&lt;\/div&gt;\r\n...\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Saw this recently on twitter and am placing it here for posterity&#8217;s sake. &lt;html&gt; &lt;head&gt; &lt;title&gt;Fizz Buzz via CSS&lt;\/title&gt; &lt;style&gt; body { counter-reset:n; } div:before { counter-increment:n; content: counter(n); } div:nth-child(3n):before { content:&quot;fizz&quot;; } div:nth-child(5n):before { content:&quot;buzz&quot;; } div:nth-child(3n):nth-child(5n):before { content:&quot;fizzbuzz&quot;; } &lt;\/style&gt; &lt;\/head&gt; &lt;body&gt; &lt;div&gt;&lt;\/div&gt; &lt;div&gt;&lt;\/div&gt; &lt;div&gt;&lt;\/div&gt; &lt;div&gt;&lt;\/div&gt; &lt;div&gt;&lt;\/div&gt; &#8230; &lt;\/body&gt; &lt;\/html&gt;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-490","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=490"}],"version-history":[{"count":1,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":491,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/490\/revisions\/491"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}