Lock Media Screen CSS

Asked

Viewed 1,073 times

1

Good afternoon, I would like to know some way to block the user from adjusting the resolution in the mobile version of the site (by sliding two fingers). As in this example: http://gruponzn.com/ (with the mobile browser you can’t keep moving in the resolution size.

This is the site I wanted to "hang" on a resolution. I have tried with max-width and min-width. http://novo.cursoasb.com.br/

1 answer

5


The META Tags of html.

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

The initial-Scale property controls the amplification level when the page is first loaded. The properties Maximum-Scale, minimum-Scale, and user-Scalable control the permission for the user to increase or decrease the page.

width

Set a width for the viewport. The values can be in PX or "device-width", which automatically determines a value equal to the width of the device’s screen. Example:

<meta name="viewport" content="width=320px">

height

Set a height for the viewport. The values can be in PX or "device-height", which automatically determines a value equal to the height of the device screen. Example:

<meta name="viewport" content="height=device-height">

initial-Scale

Sets the viewport’s initial scale.

user-Scalable

Sets the possibility for the user to "zoom in" at a certain place on the screen. It is activated when the user hits twice with his finger in one place of the screen.

Source: Tableless

  • You solved my case, Thanks @Antony. If you use minimum-Scale=1 or Maximum-Scale=1 what’s different?

  • I am complementing the answer give a read on it that explains well.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.