开发者

Div with fixed width rendering too wide in ipad

开发者 https://www.devze.com 2023-02-11 23:03 出处:网络
I\'m trying to optimize one of my pages for iPad. You can see my test-page here开发者_如何学Python:

I'm trying to optimize one of my pages for iPad. You can see my test-page here开发者_如何学Python: 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?


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;">


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">
0

精彩评论

暂无评论...
验证码 换一张
取 消