Prevent zooming on your smartphone / tablet with Bootstrap 3

5

I use Bootstrap 3 in my projects and I have a question.

I would like to know how to prevent zooming on smartphones and tablets, that zoom that is done with the "tweezer" movement or double touch.

This maintains the responsive behavior of Bootstrap, ie the width of the page should remain fixed at the same screen size.

I know this is possible because there are web applications out there (ex: Facebook, Twitter) that also prevent zooming on the mobile.

    
asked by anonymous 05.01.2015 / 14:14

1 answer

6

You can disable zoom options on mobile devices by adding user-scalable=no to the viewport meta tag.

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

This disables the zoom, so users will only be able to scroll and your site will look a bit more like a native application. This not is recommended for all sites, so use caution!

See more at official documentation .

    
05.01.2015 / 14:21