Is there such a thing as min-font-size and max-font-size?

前端 未结 11 573
隐瞒了意图╮
隐瞒了意图╮ 2021-01-29 22:13

I\'m trying to make a font in a div responsive to the browser window. So far, it has worked perfectly, but the parent div has a max-width of 525px. Res

11条回答
  •  遥遥无期
    2021-01-29 22:22

    You can do it by using a formula and including the viewport width.

    font-size: calc(7px + .5vw);
    

    This sets the minimum font size at 7px and amplifies it by .5vw depending on the viewport width.

    Good luck!

提交回复
热议问题