I’m trying to get six different colored divs (2 to a line) aligned in a hexagon.
I’ve created three divs (width:100%), each with two colored divs (width:25%) and using “position:relative” I’ve got the horizontal spacing okay.
But I can’t decrease the vertical spacing.
[CODE]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<style type=”text/css”>
div {width:100%}
.stripped { margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border-top:0px; border-bottom:0px;}
.stripped1 {background-color:black; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border-top:0px; border-bottom:0px;}
.stripped2 {background-color:gray; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border-top:0px; border-bottom:0px;}
.dRed {position:relative; top:0em; left:22%; background-color:#ff0000; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
.dGreen {position:relative; top:-1.5em; left:53%; background-color:#00ff00; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
.dOrange {position:relative; top:0em; left:12%; background-color:orange; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
.dBlue {position:relative; top:-1.5em; left:58%; background-color:#6868ff; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
.dYellow {position:relative; top:0em; left:22%; background-color:#ffff00; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
.dViolet {position:relative; top:-1.5em; left:53%; background-color:#ff00ff; height:1.5em; width:25%; text-align:center; valign:middle; font-size:12pt;}
</style>
</head>
<body>
<div class=”stripped1″>
<div class=”dRed stripped”>XXX</div>
<div class=”dGreen stripped”>XXX</div>
</div>
<div class=”stripped2″>
<div class=”dOrange stripped”>XXX</div>
<div class=”dBlue stripped”>XXX</div>
</div>
<div class=”stripped1″>
<div class=”dYellow”>XXX</div>
<div class=”dViolet”>XXX</div>
</div>
</body>
</html>
.stripped eliminates all extra space, top and bottom (I used 1 and 2 to show where the containing divs end) but I still have more space than I want between each “line” (i.e., two colored boxes.)
Setting “height” for the three outer divs doesn’t seem to do anything.
TIA for any suggestions.