search

Home  >  Q&A  >  body text

css - 移动端字体适配问题

在移动端设置

<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>

我的页面从iPhone6缩小到iPhone5后,页面内容能根据设备宽度适配,但是为什么字体的大小改变,没有做缩放和适配呢?还是高度设置一个固定值后也不做适配,这是为什么?

大家讲道理大家讲道理2786 days ago883

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 14:35:19

    You have to write the font adaptation yourself. The most commonly used mobile font unit now is rem. You can try it. If you just want to distinguish between several resolutions and set different fonts, the simplest way is to use media queries ^ - ^

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 14:35:19

    Your piece of code is just a header tag, use rem or em instead of px, and the font size should also be added to the body of the css

    reply
    0
  • Cancelreply