DEV Community

Cover image for A11y tips: let the user control the zoom
Carlos Espada
Carlos Espada

Posted on

3 1

A11y tips: let the user control the zoom

When we define a <meta name="viewport"> there are two parameters that we can use that affect accessibility:

  • user-scalable="no": disables browser zoom on a web page
  • maximum-scale: limits the amount the user can zoom

Both are problematic for users with low vision who rely on browser zoom to see the contents of a web page. It is better not to define them and to leave complete freedom to the user to manage the zoom as needed when visiting our website.

Therefore the ideal definition is:

<meta
  name="viewport"
  content="width=device-width, initial-scale= 1"
/>
Enter fullscreen mode Exit fullscreen mode

Or even not define any <meta name="viewport">, like Google does. But please don't do like Instagram:

Capture of the HTML code of Instagram, in which the meta name viewport is highlighted with several parameters that disable the possibility of zooming

This is a perfect example of how not to use <meta name="viewport" />.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more