css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

Behind every door is a festive treat all about CSS-grid!

This page uses display:grid on an unordered list to set a series of list items as equally proportioned advent calendar "doors". Just like a real advent calendar, the doors are shuffled out of order by calling each into a specific position on the grid.

If the worst comes to the worst and you can't see the grid the page will just fall back to a bullet list, with all the treats in sequence—may you get a new browser from Father Christmas this year.

Inside each door is one of 25 daily treats which appear over the main page—nested list items are hidden / displayed when you click on their parent door on the calendar.

You could extend this by validating door numbers against the current day—using JavaScript to stop people peaking, but I trust y'all not to cheat.

Comments

  1. No comments yet.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.
Loading...
Loading...