WCAG 1.4.4: Resize Text

This documentation page explains WCAG 2.1 Success Criterion 1.4.4 Resize Text, an essential guideline for web accessibility. This criterion requires that text on a webpage can be resized up to 200% without loss of content or functionality, using a browser’s built-in text resizing features rather than relying on assistive technologies or full-page zoom.

The core principle is to empower users to adjust text size to meet their individual visual needs, ensuring that critical information and interactive elements remain fully accessible and usable at larger scales.

Why Resize Text Matters

The ability to resize text is fundamental for a wide range of users, directly impacting readability and usability. Small text can be a significant barrier, leading to eye strain, fatigue, and even preventing users from accessing content altogether.

Who Benefits?

  • People with Low Vision: Individuals with moderate low vision can often read content more easily if they can increase the font size, often without needing specialized screen magnification software.
  • Older Adults: As people age, presbyopia (age-related farsightedness) makes it harder to read small text. The ability to enlarge text significantly improves their browsing experience.
  • People with Cognitive Disabilities: Some cognitive and learning disabilities (e.g., dyslexia) can make reading small or densely packed text difficult. Larger text can improve comprehension and reduce cognitive load.
  • Users with Temporary Visual Impairments: Even users with perfect vision may occasionally benefit from larger text, for instance, when experiencing eye fatigue, using a device at a distance, or due to environmental factors.

Ensuring text is resizable allows users to personalize their viewing experience, making content more inclusive and less strenuous to consume. It promotes independence and reduces the need for external assistive technologies for this specific task.

WCAG 1.4.4 Success Criterion Details

The official wording for Success Criterion 1.4.4 is:

1.4.4 Resize Text (Level AA): Text can be resized without assistive technology up to 200 percent without loss of content or functionality.

Requirements Explained:

  • “Text can be resized”: This refers to the ability of the user agent (browser) to scale text. It implies that authors should not prevent this scaling (e.g., by disabling zoom or fixing font sizes in pixels).
  • “without assistive technology”: This means using the browser’s native text-only zoom function, not a screen magnifier or other AT. Browsers typically offer this through settings or keyboard shortcuts (e.g., Ctrl + mouse wheel scroll on Windows/Linux, Cmd + mouse wheel scroll on macOS, or specific menu options to increase/decrease text size).
  • “up to 200 percent”: The content must remain fully usable and readable when the default text size is doubled. This is a common threshold for many low vision users.
  • “without loss of content or functionality”: This is crucial. When text is enlarged:
    • No clipping: Text should not be cut off or obscured.
    • No overlap: Text and other elements should not overlap in a way that makes either unreadable or unusable.
    • No loss of information: All text, images of text, and interactive elements must remain visible.
    • No loss of functionality: All buttons, links, forms, and other interactive components must remain clickable, discoverable, and fully functional. The layout may reflow (which is often desirable), but navigation and interaction should not be hindered.

Practical Guidelines for Compliance

Meeting WCAG 1.4.4 primarily involves thoughtful CSS and responsive design principles. The goal is to create flexible layouts that adapt gracefully to increased text sizes.

Do’s:

  • Use Relative Units for Text: Always use relative units like em, rem, or percentages (%) for font sizes. These units scale relative to a parent element’s font size or the root font size, allowing browsers to easily adjust them.
    body { font-size: 1rem; } /* Base font size */
    h1 { font-size: 2em; }    /* 2 times the parent's font size */
    p { font-size: 1em; }     /* 1 times the parent's font size */
  • Use Relative Units for Layout: Similarly, use relative units for widths, heights (where appropriate), padding, and margins. This ensures that the layout containers grow or shrink in proportion to their content.
    .container { width: 90%; padding: 1rem; margin-bottom: 2em; }
    .button { padding: 0.5em 1em; }
  • Implement Fluid/Responsive Layouts: Design your layout to be flexible and adapt to varying content sizes. Techniques like Flexbox and CSS Grid are excellent for creating responsive designs that reflow naturally.
    .grid-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem;
    }
  • Test with Browser Text-Only Zoom: Regularly test your pages using the browser’s text-only zoom feature. This is distinct from full-page zoom. You can typically find this in browser settings under “Zoom” or “Text Size” options, or via keyboard shortcuts (e.g., Ctrl/Cmd + Shift + +/- in some browsers).
  • Ensure All Content Scales: Pay attention not just to body text, but also headings, captions, form labels, navigation links, and any other text-based content. Interactive elements and their labels must also scale.
  • Consider Line Height: When text scales, lines can become too close together, making text harder to read. Use relative units for line-height (e.g., line-height: 1.5; or line-height: 150%;) to ensure it scales proportionally.

Don’ts:

  • Avoid Fixed Pixel Units (px) for Font Sizes: Using px for font sizes prevents them from scaling when the user adjusts their browser’s text size setting.
    p { font-size: 16px; } /* Incorrect */
  • Avoid Fixed Pixel Units (px) for Container Dimensions: Fixed widths and heights, especially on containers holding text, can lead to text being clipped or overflowing when it’s enlarged.
    .card { width: 300px; height: 150px; overflow: hidden; } /* Incorrect */
  • Do Not Disable Browser Zoom: Using meta tags like <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> is a common pitfall. The user-scalable=no part explicitly prevents zooming, failing this criterion and WCAG 1.4.4.
  • Rely Solely on Full-Page Zoom: While full-page zoom (e.g., Ctrl + Plus) can help, WCAG 1.4.4 specifically refers to text-only resizing. Designs that only work with full-page zoom but break with text-only zoom are not compliant.
  • Clip Content with overflow: hidden;: Avoid using overflow: hidden; on elements that contain text, as this will prevent enlarged text from becoming visible.
  • Use Absolute Positioning Without Care: While not inherently bad, heavily absolutely positioned elements can cause significant layout issues when text size changes, leading to overlaps or content hiding.

Code Examples

Correct Implementation

This example demonstrates using relative units for font sizes and a flexible layout that accommodates text resizing.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>WCAG 1.4.4 Correct Example</title>
  <style>
    /* Base font size for the document, all 'rem' units will be relative to this */
    html {
      font-size: 100%; /* Equivalent to 16px by default in most browsers */
    }

    body {
      font-family: Arial, sans-serif;
      margin: 2rem; /* Relative margin */
      line-height: 1.6; /* Relative line height */
      font-size: 1rem;
    }

    h1 {
      font-size: 2.5em; /* Relative to parent (body) font size */
      margin-bottom: 0.5em;
    }

    p {
      font-size: 1em; /* Relative to parent (body) font size */
      margin-bottom: 1em;
    }

    .container {
      max-width: 100%; /* Ensures it doesn't break out on small screens */
      width: 90%; /* Fluid width */
      margin: 0 auto;
      padding: 1.5rem; /* Relative padding */
      border: 1px solid #ccc;
      box-sizing: border-box; /* Include padding/border in width calculation */
    }

    .button {
      display: inline-block;
      padding: 0.8em 1.5em; /* Relative padding based on button's font size */
      background-color: #007bff;
      color: white;
      border: none;
      border-radius: 0.3em;
      cursor: pointer;
      font-size: 1.1rem; /* Relative font size */
      text-decoration: none;
    }

    /* Media queries for larger text, ensuring reflow */
    @media (min-width: 600px) {
      .container {
        width: 80%;
      }
    }

    /* Example of a layout that reflows */
    .flex-layout {
      display: flex;
      flex-wrap: wrap;
      gap: 1.5rem;
      margin-top: 2rem;
    }

    .flex-item {
      flex: 1 1 calc(50% - 1.5rem); /* Allows items to wrap and take up space */
      min-width: 250px;
      background-color: #f0f0f0;
      padding: 1rem;
      border-radius: 5px;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Welcome to Our Accessible Page</h1>
    <p>This paragraph demonstrates text that resizes gracefully. When you use your browser's text-only zoom feature (not full page zoom), you should see this text enlarge without any part of the content being cut off or becoming unusable. The layout adapts to accommodate the larger text.</p>
    <p>This ensures that users with low vision or other reading difficulties can comfortably consume the content. Interactive elements, such as the button below, also scale appropriately.</p>
    <a href="#" class="button">Click Me to Learn More</a>

    <div class="flex-layout">
      <div class="flex-item">
        <h3>Section One</h3>
        <p>Content for section one. This text will also scale along with the main body text, and the container will expand or reflow as needed.</p>
      </div>
      <div class="flex-item">
        <h3>Section Two</h3>
        <p>More content for section two, designed to be flexible. The space between items (gap) is also defined in a relative unit to maintain spacing.</p>
      </div>
    </div>
  </div>
</body>
</html>

Incorrect Implementation

This example shows common mistakes that lead to failure of WCAG 1.4.4, such as fixed pixel units and restrictive layouts.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <!-- INCORRECT: Disables user scaling/zoom -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>WCAG 1.4.4 Incorrect Example</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 20px;
    }

    h1 {
      font-size: 32px; /* INCORRECT: Fixed pixel font size */
      margin-bottom: 10px;
    }

    p {
      font-size: 16px; /* INCORRECT: Fixed pixel font size */
      line-height: 20px; /* INCORRECT: Fixed pixel line height */
    }

    .fixed-container {
      width: 400px; /* INCORRECT: Fixed width container */
      height: 100px; /* INCORRECT: Fixed height container */
      overflow: hidden; /* INCORRECT: Clips content when it overflows */
      border: 1px solid #ff0000;
      padding: 10px;
      margin: 20px auto;
      background-color: #fdd;
    }

    .button {
      padding: 10px 20px; /* INCORRECT: Fixed pixel padding */
      background-color: #dc3545;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: not-allowed; /* Just for demonstration */
      font-size: 18px; /* INCORRECT: Fixed pixel font size */
      text-decoration: none;
      display: inline-block;
    }

    .overlap-box {
        position: absolute; /* INCORRECT: Absolute positioning without care */
        top: 80px;
        left: 20px;
        background-color: yellow;
        padding: 5px;
        z-index: 10;
    }

  </style>
</head>
<body>
  <div class="fixed-container">
    <h1>Header with Fixed Size</h1>
    <p>This paragraph has a fixed font size and line height. When you try to enlarge text using browser settings, this text will not scale, and if it did, the fixed container would cause it to be cut off due to <code>overflow: hidden;</code>.</p>
    <div class="overlap-box">Overlapping text</div>
  </div>
  <p>Another paragraph with fixed font size.</p>
  <a href="#" class="button">Non-Scaling Button</a>
</body>
</html>

Best Practices and Common Pitfalls

Best Practices:

  • Use a CSS Reset/Normalize: Begin your CSS with a reset or normalize stylesheet to ensure consistent default styling across browsers, which often includes setting a base font-size on the html element.
  • Set font-size on html to 100%: This makes rem units equivalent to the user’s default browser font size, respecting their preference.
  • Prioritize rem for Layout, em for Components: Use rem for overall layout (margins, padding, global font sizes) to scale consistently with the root font size. Use em within components for elements that should scale relative to their direct parent (e.g., button text, icon sizes).
  • Use Flexible Images: Ensure images scale with the layout (e.g., img { max-width: 100%; height: auto; }) so they don’t break the layout when text pushes containers.
  • Thorough Cross-Browser Testing: Test resizing across different browsers (Chrome, Firefox, Edge, Safari) and operating systems, as text-only zoom behavior can vary slightly.
  • Content Strategy: Keep paragraphs concise and consider sufficient white space. Even with scaling text, dense blocks of text can be overwhelming.

Common Pitfalls:

  • Ignoring Browser Default Text Size: Assuming everyone uses a 16px default font size. Users might have a larger default font size set in their browser. Using rem respects this.
  • Fixed-Height Headers/Footers: If headers or footers have fixed heights and contain text or interactive elements, enlarged text can quickly become clipped or push content out of view.
  • Viewport Units for Text (vw, vh): While useful for responsive design, using vw for font sizes (e.g., font-size: 2vw;) is generally discouraged. It scales text based on viewport width, not user preference for text size, and can make text too small on large screens or too large on small screens.
  • Over-reliance on JavaScript for UI Adjustments: While JavaScript can enhance UI, core accessibility features like text resizing should primarily be handled by CSS and native browser capabilities.
  • Not Testing All Content Types: Remember to test not just paragraphs, but also lists, tables, form fields, navigation menus, modal dialogs, and dynamic content.

Related WCAG Guidelines

Success Criterion 1.4.4 Resize Text is closely related to other guidelines that promote flexible and adaptable content:

  • WCAG 2.1 SC 1.4.10 Reflow (Level AA): Requires content to present without loss of information or functionality, and without requiring scrolling in two dimensions (up to 400% zoom) for vertical scrolling content at a width equivalent to 320 CSS pixels. This builds upon 1.4.4 by ensuring the *entire layout* reflows at higher zoom levels, not just text.
  • WCAG 2.1 SC 1.4.12 Text Spacing (Level AA): Ensures that users can adjust line height, letter spacing, word spacing, and paragraph spacing without loss of content or functionality. This is important because when text is enlarged, these spacing properties also become critical for readability.
  • WCAG 2.1 SC 1.4.3 Contrast (Minimum) (Level AA): While not directly about resizing, maintaining sufficient contrast ensures that enlarged text remains readable.

Further Resources

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.