See my codepen: http://codepen.io/Chiz/pen/NAmdvr
In the :before pseudo element, I set a top and left margin of 20px each.
However, the top 20px margin seems to be applied to the main element itself (the div), while the left 20px margin seems to be applied to the :before element itself.
Why is this?
.b
{
width:100px;
height:100px;
background-color:gray;
}
.b:before
{
content:"a";
color:white;
display:block;
width:50%;
height:50%;
background-color:rgb(40,40,40);
margin:20px 0 0 20px;
}
<div class="b"></div>