Home  >  Q&A  >  body text

css - 手机端字体到底如何设置简单?什么em,DPR如何取舍,电脑端用的PX,如何适应?

PHPzPHPz2764 days ago531

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-17 12:05:45

    Use media query @media to change the font size, so the mobile phone and PC will not affect each other.

    It is recommended to use REM, you can set html{font-size:100%} Then if you change the root element html, the font size of other sub-elements will be automatically calculated and changed, which is easier to manage, unlike px one by one, calculation comparison convenient.

    If you have more things, you can use sass and less.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 12:05:45

    rem http://isux.tencent.com/web-app-rem.html

    reply
    0
  • Cancelreply