Introduction
Today we are going to talk about units of measurement that a designer working for the web should take into account
but first, an important curious fact:
The minimum recommended size for text on a web page is 16 pixels. This is because a 16-pixel font size is legible on most devices and screens without being too small or difficult to read.
However, it is important to bear in mind that the appropriate minimum size for text can vary depending on several factors, such as the type of font used, the page design and the target audience. For example, if you are creating a web page for older people or people with visual impairments, you may want to use a larger font size to ensure legibility.
In general, it is important to ensure that the font size is legible and comfortable to read, since a font size that is too small can be difficult to read and can put visitors off the page. At the same time, it is important not to use a font size that is too large, as it can make the page look disorganised and difficult to navigate.
That said… let's get to the heart of the matter.
Types of Font Size Measurement Units Used in Web Design
In web design, there are several units of measurement that can be used to specify the font size of an element. Some of the most common units of measurement are:
- Pixels (px): pixels are an absolute unit of measurement used to specify the font size of an element in terms of pixels. For example, if an element's font size is set to 16 pixels, the element's font size will be 16 pixels regardless of the screen size or the device on which it is viewed.
- Points (pt): points are a unit of measurement used in typography and are often used to specify font size in print. In web design, points can be used to specify font size, but they are usually less precise than other types of units of measurement due to differences in screen resolution and the way browsers interpret points.
- EM: the EM unit refers to the font size of the parent element of the element in which it is being used. For example, if the parent element has a font size of 16 pixels and a child element's font size is set to 2 EM, the child element's font size will be 32 pixels (2 x 16 = 32).
- REM: the REM unit refers to the font size of the page's root element, which is the HTML element. For example, if the root element's font size is set to 16 pixels and an element's font size is set to 2 REM, the element's font size will be 32 pixels (2 x 16 = 32).
- Percentages (%): percentages can be used to specify font size in terms of the parent element's font size. For example, if the parent element's font size is 16 pixels and a child element's font size is set to 200%, the child element's font size will be 32 pixels (200% x 16 pixels = 32 pixels).
Each unit of measurement has its own advantages and disadvantages and may be more suitable for certain situations. It is important to choose the appropriate unit of measurement according to the requirements
What are rem and em and how do they differ?
REM (Root EM) and EM are two units of measurement used in typography and web design to specify font sizes and spacing.
The REM unit refers to the font size of the page's root element, which is the HTML element. As already exemplified, if the root element's font size is set to 16 pixels and an element's font size is set to 2 REM, the element's font size will be 32 pixels (2 x 16 = 32).
On the other hand, the EM unit refers to the font size of the parent element of the element in which it is being used. As already exemplified, if the parent element has a font size of 16 pixels and a child element's font size is set to 2 EM, the child element's font size will be 32 pixels (2 x 16 = 32).
One of the main differences between REM and EM is that REM always refers to the root element's font size, whereas EM refers to the parent element's font size. This means that if you change the root element's font size on a page, all elements using REM will change their font size accordingly, whereas elements using EM will keep their original font size based on the parent element's font size.
Another important difference is that REM behaves more predictably and consistently across different browsers and devices, whereas EM can vary in its behaviour due to the way browsers and devices interpret the parent element's font size.
In short, REM is a more consistent and predictable unit of measurement in terms of font size and spacing, whereas EM is based on the parent element's font size and may behave less predictably across different browsers and devices.
Is rem or em better?
Generally speaking, it is recommended to use REM for most web design applications. This is because REM behaves more predictably and consistently across different browsers and devices, which can help avoid layout problems and ensure that content is displayed consistently across all devices.
Another advantage of using REM is that it is easier to use and maintain in the long term. By using REM, you can establish a scale of font sizes and spacing based on the root element's font size, which makes it easier to adjust font sizes and spacing across the page simply by changing the root element's font size.
However, there are some situations in which it may be useful to use EM. For example, if you want a child element to have a font size that is a percentage of the parent element's font size, EM may be the best option. For example, if you want a child element to have twice the font size of the parent element, you can use 2 EM. However, it is important to bear in mind that EM may behave less predictably and consistently across different browsers and devices, so you may need to carry out additional testing to ensure that the design looks correct on all devices.
In short, REM is the most recommended unit of measurement for most web design applications due to its predictable and consistent behaviour, whereas EM can be useful in specific situations where you want to base font size or spacing on the parent element's font size.


