jValdron
jValdron

Reputation: 3418

Fixed width viewport on device larger than said width

I have a website optimized for mobile, large fonts, big images, etc. Currently, I have the following viewport:

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

Which works just great on all devices I've tested with so far. However, on the iPad (the first one), which has a resolution bigger than 640, I got some white space on the right.

I'd like it so that it just zooms in or out depending on the device, is this something that I can do?

Upvotes: 0

Views: 3402

Answers (1)

Theodore Brown
Theodore Brown

Reputation: 947

The problem is caused by the maximum-scale=1 property. Your viewport size (640px) is smaller than the width of the iPad's display, but Safari won't zoom in to get rid of this whitespace because the scale is fixed to 100%. Remove the maximum-scale=1 property and the whitespace should disappear.

Upvotes: 1

Related Questions