Skip to content

Instantly share code, notes, and snippets.

@vasilisvg
Created December 23, 2011 18:41
Show Gist options
  • Save vasilisvg/1515038 to your computer and use it in GitHub Desktop.
Save vasilisvg/1515038 to your computer and use it in GitHub Desktop.
em size
/* em size */
div {
width: 1em;
height: 1em;
background: #f33;
padding: 0;
margin: 0;
border: 0;
}
<meta name="viewport" content="width=device-width,initial-scale=1">
<div></div>
<script>
document.write(getComputedStyle(document.querySelector('div'),"").height);
</script>
{"view":"split","prefixfree":"","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment