how to override font boosting in mobile chrome

后端 未结 8 1088
面向向阳花
面向向阳花 2020-12-01 09:32

Is it possible to override font boosting in mobile chrome? I searched the internet before ~including stackoverflow~.

I found that some people say it\'s impossible, a

相关标签:
8条回答
  • 2020-12-01 09:55

    Try text-size-adjust:

    html {
        text-size-adjust: none;
        -ms-text-size-adjust: none;
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
    }
    
    0 讨论(0)
  • 2020-12-01 09:56

    adding following line to my reset.css worked for me

        html * {max-height:1000000px;}
    
    0 讨论(0)
  • 2020-12-01 09:59

    There is no real possibility for disabling font boosting. There may be some hacks, but they are meant for something different and, in fact, do something different.

    0 讨论(0)
  • 2020-12-01 09:59

    For desktops, and likely mobile (haven't tested mobile), you can disable font size boosting in Chrome and FF by setting a base font size on the HTML element. For example:

    html {
      font-size: 16px;
    }
    

    This is less hacky than max-height. But, still dirty from an accessibility standpoint.

    You can also use jQuery to set this if you have to.

    0 讨论(0)
  • 2020-12-01 10:10

    It looks like there are a few people that have methods for making it work.

    Add some CSS rules or give parent element width and height.

    0 讨论(0)
  • 2020-12-01 10:17

    It is a webkit official bug. You can check on Webkit official site

    You have to target only specific element where you have to override font boosting rather than targeting unwanted elements. i.e.

    p {
       max-height: 999999px;
    }
    
    0 讨论(0)
提交回复
热议问题