【问题标题】:iOS Putting White Bar on WebsiteiOS 在网站上放置白条
【发布时间】:2012-04-25 17:15:03
【问题描述】:

我尝试了几件事,但没有解决我的问题。在 iOS 上,站点右侧会显示一个白条,截断部分内容。帮忙?

http://qusik.com/newsite/

提前致谢!

【问题讨论】:

    标签: html css ios ipad web


    【解决方案1】:

    我重新检查了您的网站,您的 ipad 图像及其容器比您的其他容器宽得多,尝试将其尺寸减小到 960-940 宽度

    【讨论】:

    • 谢谢!它仍然存在,但要小得多。
    • 对摆脱现有的白色有什么建议吗?
    【解决方案2】:

    您可能会看到该空白区域,因为您的内容溢出了您的视口,因为您的平板电脑/移动设备上的页面缩小了,解决此问题的一种方法是从你的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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-18
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      • 2019-06-02
      • 2012-08-25
      相关资源
      最近更新 更多