Jitendra Vyas
Jitendra Vyas

Reputation: 152657

What is good font-sizing method for mobile sites?

Is this still a best solution for mobile? specially for older mobiles?

body { font-size: 62.5%;  /* 16px × 62.5% = 10px */ }
h1 { font-size: 2em; /* 10px × 2em = 20px */ }
p { font-size: 1.2em; /* 10px × 1.2em = 12px */ }

Upvotes: 0

Views: 4373

Answers (2)

nLL
nLL

Reputation: 5672

I personally use

font-size: large

font-size: medium

font-size: small

and assume device will adjust the size according to it's screen. Usually works fine.

May I ask why are you trying to get css validated?

Upvotes: 1

Jeroen
Jeroen

Reputation: 63719

Good question :), wondered the same myself but not found a good article or tutorial yet.

Some things to consider when choosing what's "best" for your situation:

  • em is a friendly unit as it scales with the base font size a user may choose
  • dpi-independent resolutions like mm or cm can give you some control to make things "readable"
  • beware that not all mobile browsers may support all unit types (specially since you mentioned wanting to support older mobiles)

Upvotes: 0

Related Questions