0

I know that it is better to use rem (or em) unit instead of px, in order to keep text style scale when changing the browser's font size option.

So I only use relative unit in my projects instead of px.

But on mobile my thought is that it's not possible to change browser font size in mobile, unless there are accessiblity buttons such as 'A+' 'A-.

So I was wondering if there are any other reasons of preferring relative units instead of px in the case of mobile only ?

Yann Simon
  • 81
  • 1
  • 8

2 Answers2

1

Using px unit is not an accessibility concern as this a css pixel unit, not a physical pixel.

Text with the px unit will scale according to the zoom you chose in your browser font size.

The problem is in fact when a user use a user-defined custom css for accessibility concerns. It's easier to define one default font-size for the body element and then use relative unit for the other elements. That way you will be able to use a custom css to resize the body element and its children.

Adam
  • 17,838
  • 32
  • 54
0

Thanks stringy!

Yes I checked on a Galaxy note 4 and it's true that you can set in display options the font size!

enter image description here

So even for mobile, it's a good reason to prefer rem unit than px, as for desktop

Yann Simon
  • 81
  • 1
  • 8