【问题标题】:How to remove white space below the content如何删除内容下方的空白
【发布时间】:2014-03-12 12:17:18
【问题描述】:

我有一个简单的页面

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>
   .ui-page-theme-a {
  background-image: url(../../Resources/Bingo/WebBingo/En/Common/Images/bg.png);
  -moz-background-size-: cover;
  -o-background-size-: cover;
  -webkit-background-size-: cover;
  background-size-: cover;
}
</head>
<body >
    <div id="preloader" style='background-color: #FF5794; position: absolute; height: 100%; width: 100%; left: 0px; top: 0px;'> </div>
</body>

当我在 iPad 上的 safari 中测试它时,页面可以滚动并且页面下方有一个空白区域。我怎样才能删除它?删除元标记无效。我玩的是 jquery.mobile-1.4.1 的调试版本,这条线似乎与

base = fauxEle = $( "", { "href": fauxBase }).appendTo("head" );

在方法中

baseTagTest.

我从 jqm 中删除了加载器,所以空白不是来自那里

[1http://i.stack.imgur.com/2Scaw.jpg">

我不想使用任何类型的页脚,因为我的页面使用背景和画布。

如果我有一张图片作为主题背景,如何去除白线

【问题讨论】:

  • 使用位置:固定而不是绝对stackoverflow.com/questions/19012135/…
  • body { height: 100% !important; } 身体的高度设置为99.9%
  • 是的,我看到了这个神奇的数字(为什么是 99.9 %)。更改值不会影响此行。如果我有一个图像作为主题背景如何避免这个空白?
  • 你想要页面或正文的背景?
  • 在我的项目中,我只有一页,所以对我来说页面和正文是相等的。

标签: jquery html ios jquery-mobile safari


【解决方案1】:

我假设您正在尝试使 div 与其他内容重叠。

尝试将位置属性设置为固定,如图所示:

<div id="preloader" style='background-color: #FF5794; position: fixed; height: 100%; width: 100%; left: 0px; top: 0px;'> </div>

这将使位置相对于视口。 这意味着当用户滚动时,div 将跟随用户并停留在屏幕上的同一位置。

【讨论】:

  • 这将修复示例,但如果我有一个图像作为主题背景,白线仍然存在。
  • 假设这不会影响您的设计,您可以在正文选择器中设置背景。 body { background: ...; }
  • ui-overlay 主题在页面加载后应用,因此它将覆盖我的 css 但使用 !important 这可能会阻止我。我会测试一下。
【解决方案2】:

你可以在你的body标签中添加css,

<style>
  body{
    margin:0;
    padding:0;
  }
</style>

【讨论】:

  • 这不能解决问题。该问题仅存在于 iPad 上 iOS 的 safari 中
猜你喜欢
  • 2021-02-23
  • 2020-11-11
  • 1970-01-01
  • 2013-08-21
  • 2019-11-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多