This is my entry into the Beginner's challenge. The code is not exciting... it can be done with fewer selectors. BUT, it does one thing quite well (which was my objective)... one can resize or reshape the box (the die) and the dots will remain in their relative positions. In fact, box dimensions, circle dimensions, and circle margins are the only adjustments likely to be utilized. No math is required beyond division by 2. 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<!--
http://www.sitepoint.com/forums/showthread.php?969179-CSS-Challenge-3-Things-are-about-to-get-dicey-CSS-positioning
Thread: CSS Challenge #3 - Things are about to get dicey. CSS positioning.
Feb 4, 2013 11:11
Michael Morris
-->
<head>
<title>Dicey - Positioning</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="content-language" content="en-us">
<style type="text/css">
body > div {
background-color:#f00;
box-shadow:25px 25px 15px 0 #000;
width:420px; /* width of box */
height:420px; /* height of box */
position:relative;
border-radius:25px; /* corners of box; optional */
margin:40px auto; /* centers box on page; optional */
}
div div {
position:absolute;
width:90px; /* diameter of circle */
height:90px; /* diameter of circle */
border-radius:50%;
background-color:#fff;
margin:50px; /* distance from edge of box */
}
div:nth-child(1),div:nth-child(2),div:nth-child(3) {left:0;}
div:nth-child(4),div:nth-child(5),div:nth-child(6) {right:0;}
div:nth-child(3),div:nth-child(6) {bottom:0}
div:nth-child(2),div:nth-child(4) {top:50%; margin-top:-45px;} /* margin-top = -1/2 diameter of circle */
</style>
</head>
<body>
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>
Bookmarks