How to avoid iOS font auto-adjustment?

I'm not talking about page scaling, but rather about how MobileSafari on iOS sometimes types in some font sizes.

When exactly is this done? Can this be prevented or discouraged?

+45
css ios mobile-safari
Jun 02. 2018-11-11T00:
source share
3 answers

There were a lot of tracking issues, but: its -webkit-text-size-adjust property is -webkit-text-size-adjust .

Learn more about this and other iOS-oriented CSS .

values:

  • Percentage (default), for example. 120% , or 100%
  • auto (default)
  • none - if auto does not work for your page. However, this often causes problems with scaling. Use 100% instead. . For example, open Safari on your desktop and enlarge the page (Command-Plus) - your text will not be enlarged, although the whole page will be enlarged! Do not use none !

Please note that they can be applied not only at the page level, but also at the element / widget / container level.

(I would not just indicate a value of 100% for my site, if I were not sure that it is already optimized for small screens, and never none , since it causes problems.)




Note that in Firefox Mobile (for example, for Android and Firefox) there is a similar property, -moz-text-size-adjust , is documented here . Thanks to Costa for that.




Obviously, Microsoft also has a version for mobile IE: -ms-text-size-adjust .

+26
Jun 02. 2018-11-11T00:
source share
 body { -webkit-text-size-adjust: 100%; } 

Just make sure all your text is legible. IPhone and iPod touch have a small screen, so keep that in mind.

+76
Jun 02 2018-11-11T00:
source share

The accepted answer works, but in other webkit browsers it is blocked in font-size for people who scale. Using 100% instead of none works in both directions:

 body { -webkit-text-size-adjust: 100%; } 
+11
May 10 '12 at 18:10
source share



All Articles