N
N
Name_232021-12-06 11:57:18
css
Name_23, 2021-12-06 11:57:18

Dynamically responsive html/css font?

Good afternoon, I'm typing up a site layout and found a formula on the Internet according to which the font itself adjusts to the screen size. Here she is

`font-size: calc(25px + (40 + 40 * 0.7) *(100vw - 320px) / 1170);`
25px is the smallest possible font. 1170 - container width. There is no point in explaining the whole formula. For those interested, check out this video https://www.youtube.com/watch?v=HJZP5QsrpXs . The crux of the issue: when changing the font `line-height` remains the same. That is, with an enlarged font, the text runs over itself, and with a decrease, the indents are too large. Does anyone have a similar formula for `line-height`.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-12-06
@Name_23

line-height: normal;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question