---
id: 672bd807c49548fc9be66aca
title: What Are Some Best Practices for Working with Typography in Your Designs?
challengeType: 19
dashedName: what-are-some-best-practices-for-working-with-typography-in-your-designs
---

# --description--

Typography is the art and technique of arranging type to communicate effectively. It involves formatting text and selecting appropriate fonts. In this lesson, you will learn best practices for using typography in a way that enhances readability, hierarchy, and accessibility. 

Let's start with readability. You should choose clear and simple fonts to make your designs easy to understand. This is particularly important for the main text of your website. Users are more likely to engage with your content if the font is easy to read. Some frequently used fonts for web development are Roboto, Open Sans, Poppins, Lato, and Barlow. But there are many to choose from and you will definitely find one that fits your needs.

Text should also be large enough for everyone to read it. You should try to keep lines relatively short. The specific number of characters per line really depends on your project. But keeping lines short will make the content easier to read.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-1.png" alt="Three levels of text hierarchy: 'Heading' in large bold serif, 'Subheading' in medium bold serif, and 'Text' in small regular weight" />

You can use font size to create a visual hierarchy for headings, subheadings, paragraphs, and other elements.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-2.png" alt="freeCodeCamp's landing page showing 'Learn to code — for free.', 'Build projects.', and 'Earn certifications.' in progressively smaller text, with a 'Get started (it's free)' button below" />

For example, the main heading on a webpage should have a larger font, followed by subheadings with smaller font sizes. This will give every element in the hierarchy a specific font size that helps users navigate through the structure visually.

You should use two or three fonts at most to create a visual consistency. Using too many fonts can make the text more difficult to read and weaken your branding's identity. This can also impact the user experience by increasing the load time of the website.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-3.png" alt="freeCodeCamp's Style Guide Typography section on a dark background, listing Hack-ZeroSlash as the primary monospace font, Lato as the primary proportional font, and SaxMono as the logo font" />

Once you choose these two or three fonts, use them consistently across different pages and elements. These fonts should be consistent with the overall design of your web application, product, or service.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-4.png" alt="Two versions of the same text side by side: the top version has a green checkmark and good whitespace between lines, while the bottom version has a red X and cramped, poorly spaced text" />

You should also use whitespace to create a visual balance and enhance readability.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-5.png" alt="WCAG 2.1 Understanding Docs page showing Understanding SC 1.4.3: Contrast (Minimum) (Level AA), with explanations of contrast ratio requirements for large and small text" />

For accessibility purposes, you should follow the Web Content Accessibility Guidelines. These guidelines set the recommended contrast ratio for text. A higher contrast ratio makes text easier to read, especially for people with visual disabilities.

You should also provide options to adjust font size and avoid complex fonts as much as possible. As a general rule, you should use simple fonts whenever possible. If your content is easy to read, users are more likely to engage with it.

<img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-some-best-practices-for-working-with-typography-in-your-designs-6.png" alt="Browser DevTools open alongside freeCodeCamp's landing page in responsive mode, showing CSS styles applied to the page's heading elements" />

A final tip for working with typography is making sure that your fonts are displayed correctly on different screen sizes and devices.

Typography is a powerful tool for creating beautiful designs and engaging user experiences. By understanding the fundamentals of typography and applying these best practices, you can create effective designs.

# --questions--

## --text--

Which of the following is a very important factor for ensuring readability in web typography?

## --answers--

Using a large variety of fonts.

### --feedback--

Think about how users perceive text on a screen and what they may find helpful.

---

Maximizing font size for all text elements.

### --feedback--

Think about how users perceive text on a screen and what they may find helpful.

---

Achieving optimal contrast between text and background.

---

Aligning text to the left margin.

### --feedback--

Think about how users perceive text on a screen and what they may find helpful.

## --video-solution--

3

## --text--

When choosing fonts for a website, it's generally recommended to:

## --answers--

Use as many different fonts as possible for visual interest.

### --feedback--

Think about how font choices impact the overall look and feel of a website.

---

Limit the number of font families to improve consistency.

---

Prioritize decorative fonts over readability.

### --feedback--

Think about how font choices impact the overall look and feel of a website.

---

Use only serif fonts for body text.

### --feedback--

Think about how font choices impact the overall look and feel of a website.

## --video-solution--

2

## --text--

Which of the following best describes the concept of visual hierarchy in typography?

## --answers--

Using only one font style throughout a design.

### --feedback--

Think about how typography can guide users' attention.

---

Prioritizing the most important information through font size and style.

---

Maintaining consistent spacing between letters.

### --feedback--

Think about how typography can guide users' attention.

---

Ensuring all text is centered on the page.

### --feedback--

Think about how typography can guide users' attention.

## --video-solution--

2
