简体   繁体   中英

Disable Browser Zooming

I want to disable zooming in my website and use this code on the hade tag :

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

but it dosent work. i need a way that users cant zoom in or zoom out.

Try user-scalable=0 instead of no

<head>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
</head>

Wait, depends of what you want. Your code seems right for mobile app. But, AFAIK, it's impossible to do the same thing in browsers (like Firefox, IE...). You can always zoom in / zoom out.

viewport is not for web-browser but mobile. It's like disable right click or image download : not a good practice ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM