Answer the question
In order to leave comments, you need to log in
How to correctly calculate line-height for different headings?
Hello.
Tell me how to correctly calculate the line-height for the headings h1 ... h6 and in general in rem
How can I correctly format this in scss?
for example:
html{
font-size:16px
}
body{
font-size:1rem
}
h1{
font-size:3rem;
line-height:??????
}
h2{
font-size:2.5rem;
line-height:??????
}
$base-font-size:16px;
@function rem($px, $base: $base-font-size) {
@return ($px / $base) * 1rem;
}
p{
font-size:rem(14px);
}
Answer the question
In order to leave comments, you need to log in
I use
* {
line-height: 1.5;
}
html,
body {
font-size: 62.5%;
}
body {
font-size: 1.6rem;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question