Should A Web Designer Care About Relative Font Sizes? | Frontify (2024)

Another unit people are talking about is rem. But why do we need them instead of working with pixels? Should designers care about this?

But, why should I use relative font sizes?

First of all, I think it's good for every designer to know a little bit about CSS3. Therefore it's good to know about font sizing techniques anyway. Especially, if you're designing for multiple resolutions with responsive design. Think of generally smaller or larger font sizes on mobile phones. It takes time to recalculate every pixel value to the new base font size. This is where relative font sizes become useful. With em/rem sizing, you can change just the base font size for a specific viewport to decrease or increase all font sizes, while keeping proportions between the different styles.

What's the difference between px, em and rem?

Pixels are used for absolute font sizes. The unit em is used to calculate the size relative given as a factor (e.g. 1.5em). The factor is multiplied with the font size inherited from their parent elements.

1.5em = Inherited Font Size * 1.5 = ?

This leads to problems, because it might become complex to know the inherited font size from within the CSS. Here it comes to rem. The cool thing about this CSS3 unit is, that it always uses the root (e.g. html) font size as the base size instead of the inherited one. Therefore it is always calculable.

1.5rem = Default Font Size (e.g. 16px) * 1.5 = 24px

I'm not good at math, give me a hint!

The default font size is given by the browser and device you're site is viewed on (e.g. 16px for desktop browsers). This requires you to calculate the correct em / rem values like...

28px = 28/16 = 1.75rem

There is a trick to get rid of the math. If you're working with px in your designs, you can change the base font size to 62.5% or 10px, which results in the following easy 1/10 conversion.

28px = 28/10 = 2.8rem

No calculation needed anymore. If you're familiar with SASS or LESS, there are other ways to calculate the font size while keeping the native default font size like mentioned in Calculating EMs with SCSS.

Does this rem thing work in all browsers?

You're fine with all recent browsers and versions. If you need to provide support for IE7 and IE8, you need to workaround the inexistent rem support by providing both, the font-size in px (as fallback) and the rem value.

html { font-size: 62.5%; } p { font-size: 15px; font-size: 1.5rem; } /* =15px */

Should A Web Designer Care About Relative Font Sizes? | Frontify (2024)

FAQs

Should A Web Designer Care About Relative Font Sizes? | Frontify? ›

Especially, if you're designing for multiple resolutions with responsive design. Think of generally smaller or larger font sizes on mobile phones. It takes time to recalculate every pixel value to the new base font size. This is where relative font sizes become useful.

What is a good design rule for fonts on a website? ›

A website should keep the number of fonts to a minimum—no more than three in total. When a site has too many fonts, the user can become disoriented with so many shifts in the visual design. The chosen typefaces should have a variety of weights and styles that can be used strategically in the UI design.

Why is it best to use relative sizes for fonts? ›

People with low vision can improve the readability of a Web page for themselves by increasing the font size. They do this using the browser's text-size preference settings. If a fixed font size has been specified, though, the user cannot exercise this control.

What are the general rules for using different font sizes and styles? ›

Use no more than three font sizes and styles in your web content. Make headings larger and bolder than body text. Be consistent with font sizes and styles for each level of hierarchy. Use contrasting font styles for different types of content (e.g., serif for body text and sans serif for headings).

Should font size be responsive? ›

It's important to use responsive font sizing to improve user experience, as it gives your users a good first impression, while ensuring readability and consistency.

What is the 3 font rule? ›

In general, you should only use a maximum of three fonts per design: the title, the subhead, and the body of the text. You get an exception if your design text is long.

What is the golden rule of fonts? ›

Use the principle: Less is more

However, you also need to keep in mind the contrast. If you use two fonts that are too similar, they will not wholly draw users' attention. Try not to choose two Sans Serif fonts but instead choose a combination of Serif and Sans Serif, making your content look even more attractive.

Why is relative sizing better? ›

Relative sizing has several advantages over traditional methods of estimation, such as using hours or days. First, it is faster and easier to compare user stories than to assign precise numbers. Second, it reduces the uncertainty and variability that often affect time-based estimates.

What is a good rule for font size? ›

Optimal font sizes for desktop

Body text - Font sizes should be around 16px to 18px for legibility (or 1.6rem to 1.8rem using our sizing rules mentioned above). Keep in mind that more expressive typefaces may be less legible, so if you can afford to go a bit larger, then, even 21px can be pleasant to read.

Why is font size important in web design? ›

From a design perspective, font size is an important aspect of creating visual hierarchy and drawing the user's eye to the most important elements on the page. Larger font sizes can be used to make headlines and calls to action stand out, while smaller font sizes can be used for body text and supporting information.

What is the text size rule for graphic design? ›

Speaking of web typography, the number of characters per line should be in the range of 40–70 characters for computers and tablets and 30–40 characters for phones. For website texts, the optimal size is 16–20 px. This means that the approximate width of the text block should not exceed 760 px.

What are the four rules of typography? ›

Summary of key rules | Butterick's Practical Typography. The four most important typographic considerations for body text are point size, line spacing, line length, and font (see font recommendations), because those choices determine how the body text looks.

What is the two font rule? ›

There is a typographic rule of thumb for combining fonts from unrelated families: The more dissimilar the type designs, the better the mix. The rule, however, carries a caveat: one typeface should take the lead, and the other should be a supporting player. Two highly distinctive designs rarely combine well.

Why is responsive typography important in web design? ›

With the proliferation of various devices and screen sizes, responsive typography is crucial for ensuring that text adapts and remains legible across different devices. Implementing techniques such as fluid typography and media queries allows the typography to adjust dynamically based on the available screen space.

Why should you use relative font sizes with a responsive design? ›

Especially, if you're designing for multiple resolutions with responsive design. Think of generally smaller or larger font sizes on mobile phones. It takes time to recalculate every pixel value to the new base font size. This is where relative font sizes become useful.

What is the best practice for font sizing CSS? ›

Best Practices

Prioritize accessibility and responsiveness by utilizing em and rem units instead. Set Font Sizes with rem : Use rem units for setting font sizes in most cases. rem ensures that font sizes are relative to the root element's font size, making them responsive to user preferences and zooming.

What is the recommended font format for web? ›

The Web Open Font Format (WOFF)

WOFF is a font format for use in web pages. It was developed in 2009, and is now a W3C Recommendation. WOFF is essentially OpenType or TrueType with compression and additional metadata.

What is the golden ratio rule for typography? ›

Text Sizes

Different font sizes can be in a golden ratio. Let's say the body-font size on your website is 16px. The header-font size could be a golden-ratio multiple of your body size — that is, it could be 16 φ = 16 x 1.618 = 25.88 or roughly 26px.

What is the appropriate font for website? ›

The best font for websites depends on the purpose of the website and the target audience. However, some popular and well-regarded fonts for websites include Helvetica, Arial, Georgia, Tahoma and Roboto. Arial is another popular sans-serif font that is similar to Helvetica.

What is the rule font style? ›

Rules font features modern capitals (optically-matching widths). Next to no contrast in counter-forms. Closed edged terminals and an elegant twist bringing a colorful aspect to optical gray in text layouts. The whole font family is topped off with squared endings, giving the whole font family a great pace.

Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6030

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.