3

Are there any known problems with font-size scaling differently on Android and IPhone?

I've got a site with 107% font-size set on the HTML selector. Then I've got a media query right below it that sets the font-size to 150% for screens smaller than 500px.

If I remove the media query and view the page on an Iphone and an android, the 107% size text looks comparable in size on both devices.

If I add the media query back in, the text gets bigger on both devices as expected. However, on the iPhone it gets WAY bigger so much so that its almost 50% to 100% larger than it appears on the android! It totally breaks the layout!! This is happening on all text elements everywhere in the layout.

Is this a known problem with mobile devices or do I have some kind of compounded units problem happening?

Mxyk
  • 10,360
  • 16
  • 52
  • 75
JamesHoux
  • 1,985
  • 2
  • 19
  • 40

1 Answers1

1

Well, is it in both portrait and landscape mode, or only in landscape? Because, in landscape, fonts get bigger by default browser behaviour. Maybe one was in portrait mode and other in landscape?

See about this here > Preserve HTML font-size when iPhone orientation changes from portrait to landscape

And if this is your problem, the solution is something like>

html {
  -webkit-text-size-adjust: 100%;
}
Community
  • 1
  • 1
marinbgd
  • 729
  • 11
  • 26
  • You, sir, are my Mobile Savior! For some reason, I already had the -webkit-text-size-adjust code in the stylesheet and I thought it was just a font-size alternative to use for webkit. I was using it incorrectly because I must have copied it as a snippet of code from somewhere! I'm such a newb! Thank you for bringing this to my attention! – JamesHoux Dec 08 '12 at 16:12