11

Previously, to achieve the effect of resizing for mobile, I have only ever used width=device-width, initial-scale=1 which worked no problem.

I recently discovered user-scalable=no as an option for the meta viewport. At first I thought it was a short-cut for setting maximum-width=1, minimum-width=1, however it comes with, in my opinion, one huge advantage:

This allows them [the web browser] to get rid of the dreaded 300ms delay on touch events that the browser takes to wait and see if your single touch will end up being a double touch.

Brilliant, I thought. Some basic testing on mine and some colleagues phones does indeed seem to remove the 300ms delay and makes for a much faster feel.

Reading into user-scalable some more rings some alarm bells. The general consensus appears to be that it, along with maximum/minimum-width, is "harmful" for accessibility. Some snippets from articles or posts written this year:

"And while initial-scale=1 is pretty useful, maximum-scale is bad news for accessibility."

"More often than not, there is absolutely no need for these harmful declarations: maximum-scale=1, user-scalable=no"

What interests me is both these references link to articles written two and three years old respectively, and the arguments in each:

http://a11yproject.com/posts/never-use-maximum-scale/

By setting maximum-scale=1.0, you are disabling the functionality to use pinch zoom on mobile devices, and forcing users to view your page a certain way.

http://blog.javierusobiaga.com/stop-using-the-viewport-tag-until-you-know-ho

[...] but there are lots of cases when the user might need to zoom: small body font (at least, for the user’s needs), checking some details in a photograph, etc

and

This parameter removes the ability to zoom in or zoom out, and it’s even worse than maximum-scale. If there’s a really special reason to use it (e.g., you are coding a web app and need to avoid zooming in form inputs)

Whilst I understand some of the concerns raised, I wonder if some of the arguments are about things which aren't, or shouldn't be, problems.

For example, stating that it removes the ability to zoom on input fields, one could argue that if a user is required to zoom in on form fields on a mobile optimised site there is a different issue entirely which should be fixed by not requiring users to zoom-in in the first place.

Font size I can accept is a problem, although a workaround could be to include font size controls (used to see them a lot, possibly not so much any more).

With that in mind is possible that user-scalable=no (or max/min width) isn't quite as horrific as it sounds, and with some thought/planning with regards to accessibility it could be safe to use and benefit from the advantages it brings?

For a fair argument and a small confession, I am probably thinking a lot more about mobile phone sizes than tablet sizes. With mobile phones I feel stuff is often zoomed in sufficiently (most things just set to 100% width), the same cannot always be said for tablets I'll admit. Also, I don't suffer from anything which affects my accessibility so I am probably naive to some of the problems other people face.

4
  • Note that that the first answer (the "advantage") from StackOverflow you link is from 2011, which is Bronze Age in this industry. That was the era of the iPhone 4...
    – msanford
    Nov 15, 2017 at 14:40
  • Anecdotal: I'm a software developer in my mid-30s who uses a 32-inch monitor and I still full-screen and zoom Stack Exchange to 140% on my desktop computer so I can see it comfortably, even while wearing magnifying corrective lenses (and a fairly weak prescription). Imagine what mobile is like.
    – msanford
    Nov 15, 2017 at 14:45
  • 1
    I will say that one workflow that I find annoying is 1) I tap in a field 2) the mobile browser auto-zooms to fit the input element to the width of the mobile screen (cool, helpful, thanks) 3) the input is blurred 4) browser doesn't auto-zoom out... I'm left to "clean up" from this helpful feature by swiping my thumbs together so I can continue browsing the site as I was before... As far as I'm concerned, if they could just fix that (or give developers the ability), then I think we'd be set with the mobile zoom discussion. Nov 15, 2017 at 20:34
  • 2
    Note that, starting with iOS 10, Apple's Safari (Webkit) "allows the user to pinch zoom on every page [...] Now, we ignore user-scalable, min-scale and max-scale": webkit.org/blog/7367/new-interaction-behaviors-in-ios-10
    – chrki
    Nov 16, 2017 at 11:11

5 Answers 5

14

Stop using "user-scalable=no". Period. In the last 6 years, I cannot count the times that I've had to put away the iPhone and go to a desktop computer to examine something on a website because it simply wasn't visible and there was no way to increase its size because of this particular meta-tag. This is far and away the most useless tag. I wish it had never been created.

4
  • 3
    This and the blink tag. Absolutely horrendous.
    – Karlth
    Jul 16, 2016 at 0:19
  • So many people have mindlessly, needlessly copied and pasted this onto sites without knowing or caring that it is harmful that some browsers allow users to ignore it. For example, Opera has an option "Force enable zoom". Jan 23, 2018 at 22:28
  • 2
    If user should to be able to zoom (responsive) web apps why doesn't the same apply to native apps (or the mobile OS as a whole)? Preventing user form zooming guarantees that UI elements function as intended. For example just imagine how much less usable phone's home screen would be if zooming was available.
    – knee-cola
    Sep 18, 2019 at 14:35
  • 1
    @knee-cola the inability to zoom is a deficiency of native apps. Personally, I avoid native apps for anything other than games/multimedia for reasons like this.
    – hegel5000
    Aug 8 at 17:43
9

Do not prevent the user from zooming using user-scalable=no or maximum-width=1, minimum-width=1, unless your entire page is an interactive app with its own zoom mechanic overriding default pinch-zoom gestures, like Google Maps (but even then, consider disabling zoom more selectively, e.g. via event handlers on the inner widget container, allowing normal interactions on text containers like info boxes or search widgets).

  • There's no longer any benefit, to touch response times or anything else. The question mentions that this option used to be abused as a hack to remove the 300ms delay before touch events triggered clicks while the browser waited to see if it was a double-tap to zoom in on an old-fashioned non-responsive wide page. However, major browsers dropped this in 2014 on all pages that aren't wider than the viewport, including mobile versions of Chrome, Firefox, IE/Edge and Apple iOS.

    To remove the 300-350ms tap delay, all you need is the following in the <head> of your page:

       <meta name="viewport" content="width=device-width">
    
  • You should never prevent the user from doing something they can normally do unless absolutely necessary.

  • You should never prevent the user from doing something they can normally do unless absolutely necessary. It's worth repeating this.

  • There are many cases where preventing zooming can cause your users problems:

    • It prevents users zooming on a detail in an image. If you don't have images users might want to zoom in on right now outside of clunky slideshow widgets, don't assume a site won't in future
    • It prevents a user with poor eyesight zooming in on some text they're finding difficult to read.
    • It prevents a user with co-ordination problems, arthritis, fat fingers, etc etc from zooming in to make it easier for themselves to touch the correct link, button or input.
    • Even people with slim fingers and perfect co-ordination often want to zoom in while trying to select some specific text to copy or search on using touch.
    • It prevents someone zooming so something specific they want to show someone else, reference, or write down is large, clear and centred on the screen. For example, a phone number, reference code, name of a person or thing...
    • It's just needlessly annoying

But of course, even if you were unable to think of a single reason why a user might want to zoom in, you still shouldn't disable it, because you should never prevent the user from doing something they can normally do unless absolutely necessary.

1
  • - It prevents accidentally zooming in and getting bug reports for unusable mobile sites
    – Alexander
    Aug 12, 2021 at 17:25
8

Why zoom can be important

My parents are in their 70s and are sophisticated users for their age (mom plays video games!).

They have large mobile phones (mom has an iPhone 6 plus and dad has a Galaxy Note phablet).

Even then, they often need to zoom in to sites to read text or examine details.

Now, as a designer I'm faced with a choice.

  • I could use ultra large fonts on my site to ensure maximal coverage for all user demographics including the elderly and sight challenged. But that may mean hurting the aesthetics of the site or severely limiting the amount of information I can just just to please a small minority of challenged users.

  • I could just ignore the sight challenged and just design for the majority or "pareto" case.

  • Or I could design for the vast majority of people and retain zoom (at the cost of some pinch gesture delay) to help the sight challenged.

I may choose to ignore the sight-challenged minority, use the "least-common-denominator" large font, or just allow zoom.

Very often, sites will choose the 3rd option as a reasoned tradeoff, but I'm just delivering information you can use to make the best educated decision for your own site.

2
  • 3
    You do not have to do anything. Zooming doesn't alter the UI, it just magnifies the viewport.
    – Karlth
    Jul 16, 2016 at 0:18
  • Make sue you use relative font units (e.g. rem), so they can increase font size in device accessibility settings and it'll automatically scale up text in all well-made apps and sites. But you're right that it's still important to allow user zoom - for details on images, or zooming a tricky word etc Aug 9 at 8:38
2

"user-scalable=no" is overused. It is causing unpleasant user experience, ranging from discomfort to torture. It is part of a mindset that needs field-stripped from every programmer: the software knows best.

Humans are wondrous, amazing creatures, with far more sophisticated and faster audio and video real-time pattern recognition capability than any AI, capable of creativity and feeling, aware of their environment in a way no computer program could possibly be, but somehow, you believe your program knows better than the user if the user should be zooming in or out, or you believe scrolling and/or scrollbars should be disabled. You're not there. Humans attract one thing to themselves more than any other: exceptions. There are trillions of possibilities every second in this universe, and you think your software has accounted for them all? You want to delay shutting down, but don't know about the building being on fire? You want to reject an email address, because you didn't know about subdomains and it doesn't match your understanding of an email address pattern? You want to make a window or screen un-resizable or un-zoomable? Let me be clear: You are torturing users - knock it off! Software exists to serve the user, not the other way around.

2
  • 1
    To be honest, I think most people who still apply "user-scalable=no" don't even think about it that much. I think most are just mindlessly copying and pasting it from somewhere without even knowing or caring what it does. Which is an even worse mindset. Jan 23, 2018 at 22:25
  • 1
    Most apps does not allow for zoom and nobody has complained. Nov 19, 2019 at 12:49
2

There are very strong opinions against using user-scalable=no, but those are overlooking specific use cases where a site might actually be designed to be usable without the need to zoom, and zooming would be harmful to the experience. Let's keep that in mind. Just because people have abused a feature or used it incorrectly doesn't mean the feature itself is bad.

1
  • 2
    If you mean cases like where "your entire page is an interactive app with its own zoom mechanic overriding default pinch-zoom gestures, like Google Maps", that's accepted above. If you mean that you or your designer has convinced themselves it looks fine to them, so therefore, it's fine for everybody all the time, and therefore, users who have reasons to want to zoom are wrong and must be stopped, even if they have arthritis, or poor eyesight, or simply want to show some detail to someone the other side of a table; please, never work in a role that involves making UX decisions. Apr 24, 2019 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.