bharal
bharal

Reputation: 16164

ipad viewport - relationship between scale and width?

I'm a bit confused by the viewport mets tag, for use in mobile devices:

<meta name="viewport" content="width=1024, initial-scale=1.4, maximum-scale-1.6, minimum-scale=0.25"/>
.

What does this thing mean? I mean, I get what a view port is... it is a magical hole that you can look at a fixed-size object with. And I get that you might want to give the hole a width, because then you can determine how much of the fixed-size image you can see at a time.

But why also give it an initial scale? What is the point? Why not just set the viewport to whatever value you want it to be? What does the initial-scale add?

Also, what do the max and min values add? Why wouldn't i want the user to be able to scale as they see fit (assuming i don't disable the scaling with the 'user-scalabe=no' optional entry)?

Upvotes: 1

Views: 1147

Answers (1)

copenndthagen
copenndthagen

Reputation: 50732

As per Apple, you do not need to explicitly set the viewport width...If you just specify an initial-scale of 1, Safari assumes width=device-width in portrait mode...

The scale just controls the zoom level of the page...If you have designed your site for a particular fixed width/height, you might not want the user to be able to zoom in or out..

You can checkout the following links for more info

http://developer.apple.com/library/IOs/ipad/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html

Do remember that viewport mainly affects the mobile browsers only..

Upvotes: 1

Related Questions