Freeman
Freeman

Reputation: 1190

CSS for mobile font-size

When designing a mobile site, what's the best way to declare font-size? Currently although I'm using viewport, my text which should be only 1 line, breaks into 2 lines. Should I declare my font-size using px, em, % or (small, large, etc)? Cheers :)

Upvotes: 1

Views: 340

Answers (1)

Farzan Balkani
Farzan Balkani

Reputation: 439

Using pixel or em is fine, but if you want your fonts to look the same in the mobile view, you should add

-webkit-text-size-adjust: none;

that'll keep the size but it will affect the readability.

Syntax

-webkit-text-size-adjust: none | auto | <percentage>;

Upvotes: 2

Related Questions