2

Here is a simple table with 2 TDs. http://z5h.github.io/broken_render/broken.html

On recent Chrome / Firefox on Android they render at VERY different sizes. I'm not clear why.

On Desktop browsers they do not.

Reducing the ammount of text in the first td fixes the problem. Specifying per element styles does not change the font size. e.g. http://z5h.github.io/broken_render/broken-styled.html

Why is this?

Code is

<html>
  <head>
    <meta content='text/html;charset=utf-8' http-equiv='Content-Type'> 
  </head>
  <body>
    <table>
      <tr>
        <td>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
        </td>
      </tr>
      <tr>
        <td>Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
        </td>
      </tr>
    </table>    
  </body>
</html>

This is what it looks like on a fully up to date Chrome on Nexus 4. Same problem on Firefox.

example

Community
  • 1
  • 1
Mark Bolusmjak
  • 23,606
  • 10
  • 74
  • 129

3 Answers3

3

What you're seeing is Chrome for Android's "helpful" font boosting feature. There's no guaranteed way to disable it.

If you open the page in the normal Android browser (or anything using a WebView), you won't see this effect.

Community
  • 1
  • 1
Delyan
  • 8,881
  • 4
  • 37
  • 42
2

Most mobile browsers try to detect the main content of the page and enlarge it so that the user wont have to zoom in on pages without an explicit mobile design, this is called "Text Inflation" and is controlled by the text-size-adjust CSS property in most cases.

Stolen syntax example from the above link:

text-size-adjust: none               /* text is never inflated */
text-size-adjust: auto               /* text may be inflated */
text-size-adjust: <percentage>       /* text may be inflated of this exact proportion */

Please note that the text-size-adjust property is not standardized, and thus may have to be prefixed with -webkit-, -moz-, and other browser vendors' prefixes.

Also, not to be confused with font-size-adjust. :-)

Sleavely
  • 1,654
  • 2
  • 11
  • 18
2

I had a similar problem with irregular resizing of text on handhelds. I solved it by adding following three lines inside <head></head>.

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

Read more about the viewport meta-tag here: http://davidbcalhoun.com/2010/viewport-metatag
Hopefully this was of some help.
Good luck!

jjjjjjjjjjjjjjjjjjjj
  • 3,118
  • 1
  • 14
  • 14