Dice

SitePoint Code Challenge: CSS — Things Are About to Get Dicey

By | | Community | CSS

2

We’re running a series of code challenges on the SitePoint Forums, and this week’s challenge is to create a die face using the following HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Dicey Challenge</title>
<style type="text/css">
</style>
</head>
<body>
<div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
</body>
</html>

You will need to set the containing box to position relative, then absolutely position the six child divs within it and user border radius to transform them into circles. Your result should look something like this…

Dice challenge

Advanced Level Challenge
Using 3D transforms, present three sides of the die. You may modify the HTML as needed.

Expert Level Challenge
Spin the die 360 degrees on :hover.

You can find the answer here.

Sarah Hawk

Formerly a developer in the corporate world, HAWK (known as Sarah by her mother) said goodbye to the code and succumbed to the lure of social media. Community Manager for the SitePoint network for several years now, if she's not in front of her trusty Mac, you'll find HAWK at the gym or in the ring. If you're a member of our forums or follow us on Twitter or Facebook, you'll be familiar with ^hawk.

More Posts - Website

{ 2 comments }

John M February 19, 2013 at 3:12 pm

Nice! that a cool way to demonstrate some important techniques

Sarah Hawk February 19, 2013 at 7:20 pm

Glad you liked it John. The next challenge is coming up soon so keep an eye out. :)

Comments on this entry are closed.