Last active
August 29, 2015 14:16
-
-
Save mattmcgiv/1955e1449cc7d02224c3 to your computer and use it in GitHub Desktop.
Sets root element font-size to 16px; uses rems thereafter.
This file contains hidden or 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
| html { | |
| font-size: 16px; /*1rem=16px*/ | |
| } | |
| h1 { | |
| font-size: 3rem; /* 48px (16 times 3) */ | |
| } | |
| h2 { | |
| font-size: 2rem; /* 32px */ | |
| } | |
| p { | |
| font-size: 1rem; /* 16px */ | |
| } | |
| /* Don't forget to add rem-based margins, padding, etc */ | |
| /* Then to change all font-sizes while maintaining their */ | |
| /* relative sizes, just change the root (HTML) element's */ | |
| /* font-size. Everything else will adjust accordingly. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment