Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Chrome ignoring -webkit-text-size-adjust:none property. Text is being scaled when zoomed out

Our client requested a website, but didn't want to pay for a mobile version. We still are making it work on mobile. When zoomed all the way out, Chrome on Android (4.0) is scaling a bunch of the text. We have tried setting the -webkit-text-size-adjust:none property, but it seems to be ignored and text is still being scaled up.

Works fine on iOS.

Any suggestions?

like image 741
normmcgarry Avatar asked Jul 27 '12 19:07

normmcgarry


2 Answers

Just discovered a workaround for this. Set a max-height on a parent element of the text to be much larger than it would ever appear. For example,

<p class="intro">
  This is some text that is appearing blown up 
  and ridiculous on Chrome Mobile.
</p>

p.intro {
  max-height: 5000em;
}

You can set the max-height on any parent element. It doesn't have to be the first parent. For example,

<footer class="primary">
  <p class="intro">
    This is some text that is appearing blown up 
    and ridiculous on Chrome Mobile.
  </p>
</footer>

footer.primary {
  max-height: 5000em;
}
like image 196
bradt Avatar answered Sep 23 '22 04:09

bradt


Note that the -webkit-text-size-adjust property you mention is non-standard. Read more about it here.

Currently Chrome for Android scales text using font boosting and there's no way to disable it.

If you want a way to disable font boosting, please provide your use-case and log an issue via new.mcrbug.com.

like image 35
Boris Smus Avatar answered Sep 20 '22 04:09

Boris Smus