Badge Webflow Award Winner 2023

REM and Pixel: what is the difference on your site?

Why do we use REM instead of pixels in our web developments? A clear and precise explanation of the difference between the two units of measurement REM and pixels.

Published on 
22/2/2022
-
Amended on 
23/3/2023
-
5 min
Crossed-out pixels vs. REM

Rem and pixel (px) are two units of measurement frequently used in CSS and HTML to define font size, margin or image size for example.

However, the two units have a big difference in terms of web accessibility, because a pixel is not responsive and that's why it'sbetter to use REM. We explain why.

The pixel problem

A pixel (px) is not responsive

Pixels are a fixed value. 1 pixel = 1 pixel. It is an absolute and defined unit. This is a good point at first sight, because you can design to size, pixel by pixel.

But shouldn't bespoke be a design that adapts to its different users? That's my definition of good design. And that's where I have a problem with pixels, because as an absolute value, 1 px will always remain 1 px. It will not adapt to the preferences of the users of our websites.

The units -Pixels- therefore create barriers to web accessibility (for the visually impaired for example).

Rem Unit: the solution?

1 REM(root empheral unit ) adapts itself to the resolution choices of its user! Yes, the CSS design and HTML will adapt to the preferences defined by the user in his browser. (Google for example)

By default 1 rem = 16 pixels, but you can for example define in your preferences that 1 rem = 24 pixels. This will allow for a larger and more readable font design.

An example?

You have probably already seen this feature. On an iPhone for example. A "zoom" effect on messages, e-mails, etc. This responsive display functionality, adapted to user preferences, is a good illustration of the advantage of using REM (relative unit) on your pages.  

Changing appearance preferences in the Google browser

Test your site! Test the adaptive display of your elements and texts directly:

  1. Go to your browser settings
  2. Appearance tab
  3. Change the font size
  4. Return to your site
  5. Test your displays in REM vs Pixel

Converting pixels to REM

You have a website with a Pixel design and want to convert it to REM? It's quite simple. (Especially if you use Webflow 😉 )

1 rem = 16 pixels. So all you have to do is divide the units of your design in pixels by 16.

For example, a font that was 32 pixels in size becomes: 2 rem

32 (px) /1 6 = 2 (rem)

How to convert Pixels to REM on Webflow?

"Webflow made it easy

You can perform the division directly in the designer.

Coversion of pixels in rem in the Webflow designer

Ready to take your website to the next level?

Improve your online visibility thanks to Digidop's experience, excellence and reactivity!

Stay in touch with Digidop news!