Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* 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
You can’t perform that action at this time.