Calculate font size through cacl html { /* The 375px size of iPhone6 is used as the 16px base, and the 600px size is exactly 18px*/ font-size: calc(100% + 2 * (100vw - 375px) / 225); } @media screen and (min-width: 600px) { html { /* 600px-1000px increase 1px for every 100px wide font (18px-22px) */ font-size: calc(112.5% + 4 * (100vw - 600px) / 400); } } @media screen and (min-width: 1000px) { html { /* 1000px is 0.5px for every 100px afterward*/ font-size: calc(137.5% + 5 * (100vw - 1000px) / 1000); } } html { font-size: 16px; } Compatible with safari @media screen and (min-width: 375px) { html { /* iPhone6's 375px size is used as 16px base, 414px is exactly 18px size, 600 20px */ font-size: calc(100% + 2 * (100vw - 375px) / 39); font-size: calc(16px + 2 * (100vw - 375px) / 39); } } @media screen and (min-width: 414px) { html { /* 414px-1000px increase 1px for every 100px wide font (18px-22px) */ font-size: calc(112.5% + 4 * (100vw - 414px) / 586); font-size: calc(18px + 4 * (100vw - 414px) / 586); } } @media screen and (min-width: 600px) { html { /* 600px-1000px increase 1px for every 100px wide font (20px-24px) */ font-size: calc(125% + 4 * (100vw - 600px) / 400); font-size: calc(20px + 4 * (100vw - 600px) / 400); } } @media screen and (min-width: 1000px) { html { /* 1000px is 0.5px for every 100px afterward*/ font-size: calc(137.5% + 6 * (100vw - 1000px) / 1000); font-size: calc(22px + 6 * (100vw - 1000px) / 1000); } }