DEV Community

Discussion on: What CSS font-size units do you prefer to use?

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

In visual display media, always rem, except on the root of the document (where I usually use pixels because they are de-facto consistent across all platforms. Using rems means that the site layout works correctly no matter how much zoom the user uses, because it all scales together.

For print media it gets a bit trickier. I would normally use points there because most printers will know how to handle that correctly without multiple unit conversions (unlike other absolute units which may or may not need to be converted twice). I might use ems if I need to offset size relative to the parent font size for some reason, but would probably not use relative units for anything else, instead relying on the (sane) assumption that people are printing at the 'correct' size (and obviously handle margins correctly so that I don’t need to handle separate styles for US and ISO paper sizes).

Collapse
 
rtivital profile image
Vitaly Rtishchev

There is no need for rem nowadays, every browser scales correctly with px, em/rem has no other advantages and in most cases will produce only needless calculations for next developer who will try to work with your code.

Collapse
 
aberba profile image
Lawrence Aberba

You've been denying em, rem in all your replies. Its for responsive designs and you've been shown a link to it.

What are some designs you've created with 0x would like to see.

Thread Thread
 
rtivital profile image
Vitaly Rtishchev

Yep, that's what I do, I strongly disagree with people who use em (rem is fine) as it brings lots of complications to code and measurements.

If you need a good example of website that uses px – just land on google.com
If you are interested in how i work with px you can explore my open source app – github.com/rtivital/omatsuri