Skip to content

Instantly share code, notes, and snippets.

@tankred
Created November 26, 2014 09:58
Show Gist options
  • Save tankred/13cc2b0a1c002a4095a5 to your computer and use it in GitHub Desktop.
Save tankred/13cc2b0a1c002a4095a5 to your computer and use it in GitHub Desktop.
one-element-rules
<div class="center">
<div class="one-element">
</div>
</div>
body {font-size:5.1em;
background:#1D1F20;
}
.one-element {position:relative;
/* [1] */
border-radius:50%;
/*
width:0;
height:0;
*/
/* [2] */
width:.25em;
height:.25em;
box-shadow:
0 0 0 1em #c00, /*red*/
-3em 0 0 1em #0c0, /*green*/
3em 0 0 1em #00c /*bleu*/
;
/* [3] */
background:#c00;
}
.center {
/* [1] */
position: absolute;
left: 50%;
top: 50%;
/* [2] */
transform: translate(-50%, -50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment