Reputation: 14934
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?
Upvotes: 5
Views: 7019
Reputation: 1
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">
Upvotes: 0
Reputation: 2302
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;">
Upvotes: 9