Is it possible to have a 'line height' be dynamic without using media queries?
Ok so I have this navbar I made for my project, and on desktop, I gave it a line-height of 2rem, because it looks the best that way. (I don't want to use padding in this specific case because the way my design works). So, is there a way for this line-height to be responsive as I move on to smaller screens like mobile? I know the default is line-height: normal that does this, but in this case when I'm explicity setting it to 2rem, is it possible to make it scale on it's own, possibly without media queries?
Thanks!
1 Reply
If you set to something line-height: 1.1; it's relative to the font-size. So if you scale the font size the line height will scale. Line-height: 2rem is basically always setting it to 32px no matter the font size.