Created
May 22, 2013 13:22
-
-
Save mrwweb/5627502 to your computer and use it in GitHub Desktop.
"Sanity-ize" REMs by setting them to 10px-baseline aka "Tiny Happy Pixels Dancing."
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
/* this is the "root" in "root em." */ | |
html { | |
font-size: 62.5%; /* Now 10px = 1rem! */ | |
} | |
body { | |
font-size: 16px; /* px fallback */ | |
font-size: 1.6rem; /* default font-size for document */ | |
line-height: 1.5; /* a nice line-height */ | |
} | |
/* for everything else, rem = px/10 */ | |
footer { | |
font-size: 13px; | |
font-size: 1.3rem; | |
} | |
/* you can safely nest rems, it's still 1rem = 10px */ | |
footer small { | |
font-size: 10px; | |
font-size: 1rem; | |
} |
Great
gracias genial
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!