Skip to content

Instantly share code, notes, and snippets.

@susanahernandezd
Last active February 14, 2020 11:42
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 susanahernandezd/b1d365bc4a63d8da674a76f487e4661f to your computer and use it in GitHub Desktop.
Save susanahernandezd/b1d365bc4a63d8da674a76f487e4661f to your computer and use it in GitHub Desktop.
/* Keyword value */
line-height: normal; // = 1.2 (depending on the element's font-family)
body {
font-size: 16px;
line-height: 1.5; //16 * 1.5 = 24px
}
/*em and rem*/
html {
font-size: 12px;
}
.remExample {
font-size: 16px;
line-height: 1.5rem; /* line-height will be 12 * 1.5 = 18px */
}
.emExample {
font-size: 16px;
line-height: 1.5em; /* line-height will be 16 * 1.5 = 24px */
}
/*percentage*/
body {
font-size: 12px;
}
.percentage {
font-size: 16px;
line-height: 150%; /* line-height will be 16 * 1.5 = 24px */
}
/*pixel */
body {
font-size: 16px;
}
.pixel {
line-height: 12px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment