DEV Community

Discussion on: [Challenge] 🐝 FizzBuzz without if/else

Collapse
 
stephanie profile image
Stephanie Handsteiner • Edited

Easy, just do it in CSS.

ol {
    list-style-type: inside;
}

li:nth-child(3n), li:nth-child(5n) {
    list-style-type: none;
}

li:nth-child(3n):before {
    content: 'Fizz';
}

li:nth-child(5n):after {
    content: 'Buzz';
}
Enter fullscreen mode Exit fullscreen mode

Needs some Markup to display obviously.

Collapse
 
ben profile image
Ben Halpern

Ha!

Collapse
 
nombrekeff profile image
Keff

Magnificent! I knew there were going to be really neat solutions!!

Thanks for sharing your solution πŸ’ͺ