网站底部的空白
我的网站内容和窗口底部之间存在间隙,几天来我一直在尝试删除该间隙,但尚未找到解决方案。请参阅 http://bpc.paulsham.com 或下图。
根据我的尝试, 有没有边距或填充,
没有下边距,并且页脚中嵌套的 div 没有任何会影响它的下边距。使用 Firebug,看起来实际的
是从窗口的位置拉出的。这是一个基于 Drupal 7 的 Bartik 默认主题的自定义主题,但我认为这是一个 CSS 问题。然而,我开始怀疑这是否是一个文档类型问题,但一切似乎都验证得很好。
感谢您的帮助,如果需要更多信息,请告诉我。
I have a gap between the content of my website and the bottom of the window that I've been trying to remove for a few days and have not found a solution to. Please see http://bpc.paulsham.com or the image below.
From what I've tried, the <body>
has no margin or padding, the <div id="page-wrapper">
has no bottom margin, and no divs nested in the footer have any bottom margins that should affect it. Using Firebug, it seems like the actual <html>
is pulled up from where the window.
This is a custom theme based on the Bartik default theme of Drupal 7, but I think this is a CSS issue. I am, however, beginning to wonder if this is a doctype issue, but everything seems to be validating fine.
Thank you for your help and please let me know if this requires more information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
#page-wrapper
上,添加overflow:hidden
以清除浮动。#page-wrapper
上,删除box-shadow
规则。这消除了间隙。
我确实设法在阴影中添加回来,同时防止间隙重新出现。
它的内容是这样的:
overflow:hidden
添加到#page
中。width
和margin
属性从#page-wrapper
移动到#page
。box-shadow
属性读取到#page
。背景
-#page-wrapper
不应再具有背景
。有几个地方应用了一个。#page-wrapper
, addoverflow: hidden
to clear the floats.#page-wrapper
, remove thebox-shadow
rules.That removes the gap.
I did manage to add back in the shadow while prevent the gap from re-emerging.
It went something like this:
overflow: hidden
to#page
.width
andmargin
properties from#page-wrapper
to#page
.box-shadow
properties to#page
.background
s -#page-wrapper
should not have abackground
any longer. There's one being applied in a couple of places.通过 Google 调试器,使用选择元素按钮将鼠标悬停在上方以查找每个元素的边距或填充。找到显示额外边距/填充的元素后,将以下 CSS 添加到该元素。
例如
p {margin-bottom: 0px;}
Go through the Google Debugger, use the select element button button to hover over to find each elements margin or padding. Once you find the Element that shows extra margin/padding add the following CSS to that element.
E.g.
p {margin-bottom: 0px;}
试试这个 CSS 代码:
Try this CSS code:
问题是页脚中的clearfix:
删除
class="clearfix"
,间隙就消失了。更新
显然并非在所有浏览器中都如此;见评论。三十点的方法可能是可行的方法。
The problem is the clearfix in your footer:
Remove
class="clearfix"
, and the gap is gone.Update
Apparently not in all browsers; see comments. thirtydot's method is probably the way to go.