thecodezone.
The Code Zone

PLAYBOOK WORKSHOP / HTML & CSS · STEP 1 OF 16

Build a CSS Dice Roller

GUIDED PRACTICE

Build a CSS Dice Roller

Work through the checklist, then choose Run & check this step below the editor. Keep your earlier faces, CSS and all supplied comments. A passing check unlocks the next step.

Your code stays in one editor through every step. Word wrap is enabled.

Step 1 of 16

Name your dice gallery

The supplied main element holds the project. Its gallery div will hold six separate examples. The comments show exactly where each new copy belongs.

Your task

Work through the checklist, then choose Run & check this step below the editor. Keep your earlier faces, CSS and all supplied comments. A passing check unlocks the next step.

To pass this step:

  • Select index.html. Inside the main element, directly below the GALLERY TITLE comment, add an h1 element.
  • Make its text My Dice Roller.
  • Keep the div with class gallery, all six face comments, the ROLLER comment and the two file links.

Press the play button labeled Run & check this step below the editor to run your code and see your check results.

A hint for this step

An h1 is a page heading. For example, <h1>My project</h1> has opening and closing tags around the text. Use this step’s requested title.

Your editor is opening.

Each step builds on the last. Finish the current step before opening the next one; your code stays with you.

Code and completed steps save in this browser when signed out. Sign in to save across devices.

Ready to checkRun the checks to see your results here.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

Step 17: Export your project

You built it. Keep experimenting and share what you made.

  • Choose Open in CodePen to copy your current HTML and CSS plus the supplied JavaScript into a new tab.
  • Roll several times. Check that the announced number matches the dots. Repeated numbers are valid.
  • Sign in to your own CodePen account and choose Save to keep your Pen.
  • Copy your saved Pen’s link when you want to share it with the community.

The JavaScript behavior is supplied for you. In this workshop, you practice HTML and CSS. The JavaScript is included in your exported project so the interactive behavior still works.

This optional export adds a removable HTML comment linking to this workshop. It sends your code to CodePen only when you choose the button. Saved public Pens can be viewed by others. Later CodePen edits do not sync back here, and your Code Zone progress stays separate.