当我尝试在iphone上访问我的网站时,似乎初始比例无法很好地工作。.宽度不适合屏幕并且在Google上搜索了很多次,但是似乎没有任何办法可以解决我的问题..有人可以帮助我吗?

元标记:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1">


CSS:

@media screen and (max-width:480px){
    ...
}


这是网址http://www.estudiocaju.com.br/homolog/dleve/home/

最佳答案

<!-- iPhone Retina -->

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<!-- iPhone 5 -->

<meta name="viewport" content="initial-scale=1.0,width=320.1">


设置启动图标/启动屏幕:

     <!-- iPhone (Retina) -->

    <link href="imgs/apple-touch-icon-114x114.png"

    sizes="114x114"

    rel="apple-touch-icon">

    <link href="imgs/apple-touch-startup-image-640x920.png"

    media="(device-width: 320px) and (device-height: 480px)

    and (-webkit-device-pixel-ratio: 2)"

    rel="apple-touch-startup-image">

    <!-- iPhone 5 -->

    <link href="imgs/apple-touch-startup-image-640x1096.png"

    media="(device-width: 320px) and (device-height: 568px)

    and (-webkit-device-pixel-ratio: 2)"

    rel="apple-touch-startup-image">

关于html - 视口(viewport)初始比例错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14615784/

10-11 08:12