2013-04-09 155 views
1

我的一个朋友创建了一个网络手机,它显示了我在定位手机时遇到的一些问题。它看起来不错,但是当用户改变方向时,它显示出一个问题。网站是http://www.tivag.ch/app。当页面加载时,它可以在纵向模式下正常工作,当我在横向模式下更改时也可以正常工作,但是当我以纵向模式返回时,它会向我显示一个问题,它向我显示右侧的空白空间。当页面以纵向模式返回时,document.width保持横向模式的宽度,但不会更改该值。比例不起作用:)Safari浏览器和谷歌浏览器的方向规模

回答

1

使用overflow:hidden; .content elememt。

.content { 
width: 100%; 
overflow:hidden; /*Important*/ 
height: auto; 
float: left; 
padding-bottom: 15px; 
background: url(../img/bg_content.jpg) no-repeat center top; 
-webkit-background-size: cover; 
-moz-background-size: cover; 
-o-background-size: cover; 
background-size: cover; 
} 

以及进一步的一致结果将其添加到您的头部分。并且不要使用最小比例=“1”

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