#dotCSS presentation by @TimPietrusky http://slides.com/timpietrusky/one-element-rules#/
Created
November 26, 2014 09:58
-
-
Save tankred/13cc2b0a1c002a4095a5 to your computer and use it in GitHub Desktop.
one-element-rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="center"> | |
<div class="one-element"> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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