Рубрики

paint

How do I zoom in on the text?

These fine people helped write this article:


Zoom & Resizing Text

Users with low vision may prefer to have their browser resize text or zoom into page content to make it easier to read.

Enlarging text is primarily the browser’s responsibility. Browsers accomplish this chiefly in one of two ways: enlarging the font size only, or zooming into the entire page and applying responsive styles, as appropriate.

Developers should code in such a way that does not interfere with the browser’s default ways of enlarging content. Developers should verify this for themselves.

Instructions for how to zoom or resize text in common browsers:

  • Safari: changing font size and zoom level
  • Chrome: zoom and set font size
  • Firefox: font size and zoom
  • Microsoft Edge: making text larger

It is also important to avoid providing images of text, as such text cannot be resized through text resizing, and may become blurry when zoomed.

Avoid Clipped, Truncated, Obscured, and Overlapping Text

A developer’s primary responsibility is to insure that, when enlarged, text doesn’t become illegible when zoomed because it overlaps with adjacent text or truncated altogether:

Google search results with text resized to 200%, showing overlapping and clipped text

These kinds of problems are more likely to occur with text resizing rather than with zooming content. While a page technically fulfills the WCAG criteria if it allows either text resizing or zooming, it is best practice for developers to accommodate both if possible.

Avoid Horizontal Scrolling

Internet users expect to scroll vertically. But, they may not be accustomed to scrolling horizontally, or may lack the motor ability to do so. Developers should avoid horizontal scrolling on viewports 320px wide and larger.

To allow for maximum support of browser zooming and resizing, developers should follow a few best practices:

  • Use CSS, rather than tables, for layout.
  • Define font sizes and text container dimensions in relative units, such as ems, rems, percents, or named font sizes. Avoid explicitly defining the width and height of containers in pixels.
  • When scripting, calculate the size and position of elements such that they scale with text size.
  • While WCAG 2 does not give a mandate for a minimum font size, it is best that developers use generous, legible font sizes.
  • Provide sufficient space between columns of text to mitigate the risk of text overflowing their containers.
  • If images of text must be used, the text should be at least 18pt (24px).

Zoom in and out of a website

Here’s how you can zoom in and out of individual websites.

  1. Click the menu button Fx89menuButtonon the right. The Firefox menu will open, and you will see the zoom controls at the bottom. Fx103MenuPanel
  2. Use the + button to zoom in, and the – button to zoom out. The number in the middle is the current zoom level – click it to reset the zoom to the default zoom level. You can also see the current zoom level in the address bar:

Fx103addressBarZoomLevel

Keyboard shortcuts: You can also use the zoom controls without a mouse. Press and hold Command Ctrl while pressing &#43 to zoom in, – to zoom out, or 0 to reset.

The zoom level is saved per hostname, even after you close Firefox. For example, all pages on support.mozilla.org share the same zoom level setting, but it is different from the zoom level setting of the pages on blog.mozilla.org.

Pinch to zoom

This feature allows users to zoom in and out of pages by using a pinch motion without affecting the layout of the page.

The pinch action is currently supported on Windows and Linux through touchscreen and high precision touchpads, and on Mac through touchpads.

How to only change the size of the text

Instead of changing the size of everything, you can just change the size of the text.

  1. Press the Alt key to temporarily bring up the traditional Firefox menu. On the menu bar at the top of the screen, click View , then go to Zoom .
  2. Select Zoom Text Only . This makes the controls only change the size of text; not images.

How do I zoom in on the text?

Cart

Text Zoom Accessibility Tips

Text Zoom Accessibility Tips

Share

Back in the day when a user would use Ctrl/Cmd with +/- keys to zoom in and out, browsers would increase the text size only. This would increase readability with plain text content, but static content, such as imagery, would remain.

Today, when someone uses the browser default zoom feature, modern browsers zoom by decreasing the viewport size; as content increases, CSS breakpoints will fire and display content designed for smaller screens. This results in everything appearing larger while remaining readable.

While the modern-day viewport zoom feature is appreciated, some folks still use tooling to increase text size only. Depending on how the CSS was coded, zooming text only could lead to some accessibility barriers, mostly readability of plain text content.

According to 1.4.4 Resize text, users should be able to zoom up to 200% and still have text content be readable.

Problematic CSS

These issues usually stem from CSS which utilizes static units, that is, pixels for sizing. Take the following example:

.card

With this CSS, when someone zooms in via text, the static sizing will restrict readability of the text; content sizing will increase but text will be restricted from view.

Flexible sizing units

To get around this issue, allow for text and content containers to grow organically when text is resized. When writing accessible CSS, static sizing units such as px are to be avoided. Whenever possible, use flexible units such as % , em , or rem .

.card

With this CSS in place, the content container will now resize along with the text when a text-only zoom is initiated. This is due to the em unit sizing being based on the container font size.

Check out the demo:

How to test

There are some Chrome browser extensions you could use to test, but what's recommended is to use the built-in text zoom functionality with Firefox. Here's how to accomplish this:

  1. Load the website in question with Firefox
  2. Ensure text zoom is enabled by going to "View", select "Zoom", and select "Zoom Text Only"
  3. Adjust the text size to 200% using the Cmd / Ctrl and + keys, and view the page content

What's expected is as text increases in size, elements scale accordingly. However, often what actually takes place is as text increases in size, content is obscured and difficult to read. This is the accessibility barrier we need to avoid.

Remember, what's important here is that text content is readable and consumable. Often when text is zoomed to 200% , the layout and other pieces may appear less than ideal, but if the content is readable you'll have satisfied this requirement.

WCAG success criteria

This comes back to 1.4.4 Resize text which states:

"Except for captions and images of text, text can be resized without assistive technology up to 200 percent without loss of content or functionality."

Colin Wynn
the authorColin Wynn

Leave a Reply