如何删除我网站上的白色 space

How to remove white space in my website

如屏幕截图所示,我无法删除底部的白色 space。我尝试了一些解决方案,但它们不起作用。如果这个问题有任何解决方案,请告诉我。 http://www.rovedashcam.com/

第一个选项:

body { overflow-x: hidden; }

应该可以解决问题。
如果没有,可能有以下几个原因:

  • 您没有正确加载.css
  • ... 或者您的 .css 文件已损坏且未被解析(它也可能被部分解析,具体取决于它的损坏方式

你注意到我没有关闭上面的括号吗?这很容易破坏 CSS 文件...


第二个选项:
将其添加到页面的 <head> 标记内,就在结束 </head>:

之前
<style>body>script+div[style^="text"]{display:none}html,body {overflow-x:hidden!important}</style>

这也会使页脚的广告丢失。
如果这不起作用,我会扬起眉毛。我保证。


选项三

如果上述方法不起作用,请删除它们中的每一个并将此代码放在 </body> 结束标记的末尾之前。 之前,而不是之后:

<script type="text/javascript">
var css = 'body{overflow-x:hidden!important}body>script+div[style^="text"]{display:none!important;}',
    head = document.head || document.getElementsByTagName('head')[0],
    style = document.createElement('style');

style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}
setTimeout(function(){
    head.appendChild(style);
}, 500);
<script>

bootstrapsection { display:block }是问题所在

添加

#footer_area { display:inline!important }

或类似

尝试添加 #header_area { overflow: hidden; }

我不能说出确切原因,但我知道在 Firefox 中不存在这个问题,但是 Chrome 它是 (webkit) 并且当我删除字体大小声明和 -webkit-tap-highlight-color 来自 html {} 问题消失了。

不幸的是,我无法真正测试它,因为我无法呈现您的代码,但我认为您禁用了这些行,您应该没问题。 Font-size 应在 html 上以 % 而非像素为单位声明。

编辑:并确保您的 css 重置出现在 bootstrap 之前,您的自定义 css 出现在重置之后并且 bootstrap.

/* bootstrap.min.css */

html {
    font-size: 10px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

尝试将此添加到您的 CSS:

body {
   min-height: 100vh;
}

这会将您的身高设置为完全。它应该可以工作,我只是检查将它添加到您的网站中并且效果很好。

观看来自 Google Chrome 开发人员的视频,了解有关适合页面的更多信息:https://youtu.be/299RZ0d1LQY