• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How do I fix a font size problem on Android Chrome?

davidao

Lurker
Oct 25, 2022
2
2
I hope this is the right place to ask this. I am creating a set of web pages (bare-bones static HTML) that will be read by arbitrary users, but mostly Android Chrome on phones. The basic problem is that under certain circumstances, the text of paragraphs becomes really tiny. There is no problem on Firefox or Opera (Windows), on Chrome on a PC, or anything on a Mac or Iphone. The simplest version of the problem is when a paragraph has fewer than 2 lines, for example:

<html><body><p>This is one very short paragraph</p><p>This is a second short paragraph</p></body></html>

I have tested this on two Android phones using Chrome and a Lenovo Tab tablet. If you add enough text to those paragraphs that it goes over 2 lines (given the 6pt or so type that it displays in), the point size becomes correct. I have experimented with various ways of explicitly setting the size, such as

<p style="font-size:120%;">

for each paragraph, also using pt and em, and this does not cure the problem, though with some settings it kicks the can down the road (sometimes it works at 117% size). The second circumstance is if there is any button in a paragraph, thus

<p>This is a small <button>button</button> in a paragraph. No matter how long the paragraph, the whole paragraph is in really small print</p>

Setting an explicit size for the button (and / or paragraph) has no effect. The pages are loaded with buttons (which play sound) I would like the problem to go away, I have no idea if this can be fixed but it seems pretty bizarre and surely I'm missing something obvious.
 
It sounds like your web page needs a responsive design so that it can adapt itself to display correctly on a variety of screen sizes.

This site may help you get started:
https://www.w3schools.com/html/html_responsive.asp

Otherwise searching the web for "responsive design" should help you find some other tutorials.

Good luck!
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones