5

I'm trying to optimize one of my pages for iPad. You can see my test-page here: http://demo.dennismadsen.com/ipad/

It contains a black box with a width of 800px. When I see it on my iPad and take a screenshow, I can see, that the box is more when 800px width - about 837px: http://demo.dennismadsen.com/ipad/screenshot.png

I'm wondering why this is happening?

1
  • 1
    Can't the ipad do funky stuff like zoom in, zoom out? make sure your display is at 100%. Commented Feb 17, 2011 at 17:07

2 Answers 2

9

Regardless of the actual width of your website and its elements, iOS devices will try to scale your content for optimum viewing.

Stop that happening by putting this in your HTML header:

<meta name="viewport" content="initial-scale=1.0;"> 
Sign up to request clarification or add additional context in comments.

3 Comments

I usually use this <meta content="initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"> which makes the view locked to a 1.0 scale, and not user zoomable at all.
@Squeegy True, but iOS users expect to be able to pinch-zoom, so I wouldn't routinely advise developers to disable that functionality unless it was a specific requirement.
Depends. If you are presenting a native style interface, that happens to be shown in a WebView, people wont expect it to be behave like a webview. And it you are designing to fit pixel perfect on the device there isn't much benefit to allow zooming.
0

Check the <meta>-tag above the <title>-tag where the max width and min-width define

use this code:

<link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet"> <link media="screen and (min-device-width: 481px)" href="not-small-device.css" type="text/css" rel="stylesheet"> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.