How do I increase the font size based on the window width?

后端 未结 8 1318
一向
一向 2020-12-05 08:26

I am creating a web-based app that will be displayed on television and other large monitors. I am wanting a quick and easy way to increase the font size to fit the window si

8条回答
  •  醉梦人生
    2020-12-05 09:00

    Heres a simpler and no-jquery solution:

    onresize=onload=function(){document.body.style.fontSize=window.innerWidth+"px"}
    

提交回复
热议问题