00 Votes

Responsive Webdesign: User should not be allowed to zoom

Question by Guest | 2017-12-26 at 13:09

I recently made my website responsive by designing all content scalably and adding the following line to the head of my page:

<meta name="viewport" content="initial-scale=1">

On my smartphone, the website is displayed as expected, but I can still zoom in and out of the page. I have seen other responsive websites where this was somehow prevented.

How can I prevent the visitor from zooming on my page? Do I need JavaScript for that?

ReplyPositiveNegative
0Best Answer0 Votes

You do not need JavaScript to prevent users from zooming your responsive website. Just add "user-scalable=no" to your viewport line above:

<meta name="viewport" content="initial-scale=1, user-scalable=no">

This prevents zooming.

But think carefully about whether this setting really makes sense and how it changes the user experience. There are many webpages where I would like to zoom in on a picture or zoom out of a large table, for example, which will all be prevented by this property.
2017-12-26 at 21:28

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.