So here I am trying to learn how hexagons work. I currently saved a codepen which is the following:
http://codepen.io/anon/pen/QweBra
modified from webtiki codepen
#categories li{
position:relative;
list-style-type:none;
width:27.8em;
padding-bottom: 32.1em;
float:left;
overflow:hidden;
visibility:hidden;
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
}
#categories li:nth-child(3n+2){
margin:0 1em;
}
#categories li:nth-child(6n+4){
margin-left:0.5em;
}
#categories li:nth-child(6n+4), #categories li:nth-child(6n+5), #categories li:nth-child(6n+6) {
margin-top: -6.9em;
margin-bottom: -6.9em;
-webkit-transform: translateX(50%) rotate(-60deg) skewY(30deg);
-ms-transform: translateX(50%) rotate(-60deg) skewY(30deg);
transform: translateX(50%) rotate(-60deg) skewY(30deg);
}
#categories li *{
position:absolute;
visibility:visible;
}
#categories li > div{
width:100%;
height:100%;
text-align:center;
color:#fff;
overflow:hidden;
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
-webkit-backface-visibility:hidden;
}
As you can see I dont understand the underlying magic behind the positioning. Eventhough my em values are the same it doesnt work out. The hexagons are displaced as opposed to the original codepen.
What is the reason?
Ok nearly getting there: