Bigger fonts on smaller screens without @media queries or javascript?

后端 未结 5 967
梦如初夏
梦如初夏 2020-12-29 09:29

Is there an alternative for @media queries to accomplish font-size inversely proportional to the screen size? (e.g.: opposite effect of 2vw, where the font gets

5条回答
  •  太阳男子
    2020-12-29 10:31

    You can use relative font-styling. like -

    html, body {
    font-size: 16px;
    }
    
    h1 {
    font-size: 2.5em;
    }
    
    p {
    font-size: 1em;
    }
    

提交回复
热议问题