【发布时间】:2012-04-25 17:15:03
【问题描述】:
【问题讨论】:
【问题讨论】:
我重新检查了您的网站,您的 ipad 图像及其容器比您的其他容器宽得多,尝试将其尺寸减小到 960-940 宽度
【讨论】:
您可能会看到该空白区域,因为您的内容溢出了您的视口,因为您的平板电脑/移动设备上的页面缩小了,解决此问题的一种方法是从你的header 并用它创建一个.bg div 并将它绝对定位(在各个方向上拉伸它,例如top:0; right:0; bottom:0; left:0;),相对于身体,它会在你的屏幕上向各个方向拉伸,如下所示:
.bg {
background-color: #000000;
background-image: url("images/tint_blue.png");
background-position: 50% 0;
background-repeat: no-repeat;
border-bottom: 1px solid #FFFFFF;
position:absolute;
top:0; left:0; bottom:0; right:0;
z-index:-1; /* to place it behind everything else, just make sure not to have bg colors on your page elements */
}
另一种(虽然非常不正统)的方法是将背景图像和颜色放在html 标签上,如下所示:
html {
background-color: #000000;
background-image: url("images/tint_blue.png");
background-position: 50% 0;
background-repeat: no-repeat;
border-bottom: 1px solid #FFFFFF;
}
【讨论】: