Skip to content

Instantly share code, notes, and snippets.

@oli
Created December 12, 2011 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oli/1464828 to your computer and use it in GitHub Desktop.
Save oli/1464828 to your computer and use it in GitHub Desktop.
matrix() units for variables e & f
/* matrix() units for variables e & f */
body {font-size: 10px;}
div {
width: 100px;
height: 100px;
border: 1px solid black;
line-height: 180px;
text-align: center;
}
span {font-size: 20px;}
.unitless {transform: matrix(1,0,0,1,50,-50);}
.px {transform: matrix(1,0,0,1,50px,-50px);}
.percent {transform: matrix(1,0,0,1,50%,-50%);}
.em {transform: matrix(1,0,0,1,5em,-5em);}
<!-- content to be placed inside <body>…</body> -->
<div class="unitless"><span>unitless</span></div>
<div class="px"><span>px</span></div>
<div class="percent"><span>percent</span></div>
<div class="em"><span>em</span></div>
{"page":"html","view":"split-vertical"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment