user1825699
user1825699

Reputation:

Automatically Increase Font size based on the screen size in Mobile App

How do I increase the Font size based on the screen size?

I have some text that remains the same size in the iPhone and IPad. I want to increase and/or decrease the Font size based on the screen size.

Upvotes: 2

Views: 3305

Answers (3)

Raja O
Raja O

Reputation: 644

visit this for automatic font streching : Is it possible to dynamically scale text size based on browser width?

Upvotes: 1

imaginethepoet
imaginethepoet

Reputation: 864

The question up above with the media query (dean) is correct. You also need to make sure for iPhone that you have -webkit-text-size:none - Otherwise iphone will scale fonts, regardless of your font setting.

Also if you want to capture larger phones you may need to modify the query. Especially as we are getting much larger screen smartphones now in the Android market.

Upvotes: 0

Dean
Dean

Reputation: 6364

You should do this using media-queries. e.g.

@media (max-width: 480px) { 
    body { font-size: 1.2em; } /* increase the base font size on landscape phones */
}

Upvotes: 3

Related Questions