Currently, I am trying to make a square equal to 4 triangles of the same size that the events induce on them.
I create triangles like this
.right, left, .top, .bottom {
position: relative;
width: 26px;
}
.right:before{
position: absolute;
display: inline-block;
border-top: 26px solid transparent;
border-right: 26px solid #eee;
border-bottom: 26px solid transparent;
left: 26px;
top: 0px;
content: '';
}
What I find is that each triangle sits above each other and only one triangle can be seen, here is my example,
http://codepen.io/anon/pen/qdmbKz
As you can see, only the bottom triangle (hover at the bottom of the square) is dependent. What am I doing wrong? Is there a better way to do this?
source
share