tambourine
tambourine

Reputation: 41

px or em when creating a website for mobile devices?

I'm creating a website and I want it also to be prepare for mobile browsers. In theory, using em instead of px will allow the layout to re-size more easily based on user preferences. But nowadays, as I understood, modern browsers can resize px layouts as well as em layouts so it might not be as relevant as it was some years ago.

BUT, What about mobile browsers? How the use of one or the other will be better off for mobile devices?

If you could help me out with this question, I would be very much grateful!

Cheers.

Upvotes: 3

Views: 1146

Answers (2)

Vladimir Starkov
Vladimir Starkov

Reputation: 19803

Mobile browser handle font-size defining with pixel perfectly, because they are using for rendering not usual physic pixel but screen pixel.

Similar question has the same answer:

“px won't be a real actual pixel when the screen is zoomed out on a modern mobile browser. These browsers are effectively emulating a desktop browser with desktop browser-size pixels.”

I totally agree with this statement

Upvotes: 3

Rich Bradshaw
Rich Bradshaw

Reputation: 72965

It really doesn't make any difference. Percentages will be useful for widths, but for fonts stick to your preference.

Upvotes: 2

Related Questions