How can I scale font size of text to fit inside a

2019-09-05 17:12发布

Hello I am fairly new to all of this. I have built my layout using divs that have their dimensions set as percentages so that they scale to the correct size when the browser window is resized. Some of the divs form buttons in a navigation bar (with text on each). But when I resize the browser window the text stays large. Is there any way to solve this?

1条回答
看我几分像从前
2楼-- · 2019-09-05 17:26

Use this:

iStandardWidth = 960;
topofthetopdiv.style.zoom = parseInt(window.innerWidth/iStandardWidth, 10);
查看更多
登录 后发表回答