【问题标题】:How to remove white space gap between body and footer?如何消除正文和页脚之间的空白间隙?
【发布时间】:2015-09-26 19:55:56
【问题描述】:

正如您在标题中看到的那样,我现在正在创建的网站的正文内容和页脚之间有空白!我正在使用 wordpress 和通过编辑器进行编码,我试图从网站正文和页脚中删除填充和边距。我还尝试将其设置为相对并将其相互移动,但是当我移动它们时,间隙只是移动位置。当我设置页脚的相对位置并添加 -top 以将其连接到正文时,间隙在页面下方。请帮忙!提前谢谢你:D

这是主页面内容的CSS代码,以及页脚:

/* This is inner site (body) content style */

.site-inner {
	background-color: #fff;
	clear: both;
	padding-top: 40px;
}

.minimum-landing .site-inner {
	margin: 40px auto; 
	padding: 60px 60px 20px;
	width: 800px;
}
/* This is footer CSS code */

.site-footer {
	background-color: #231F20;
	letter-spacing: 1px;
	padding: 60px 0;
	text-align: center;
	margin:0;
}

.site-footer a,
.site-footer p {
	color: #999;
}

.site-footer a:hover {
	color: #fff;
}

.site-footer a {
	border: none;
	font-weight: 300;
}

.site-footer p {
	font-family: 'Roboto', sans-serif;
	font-weight: 300;
	font-size: 14px;
	margin-bottom: 0;
}

【问题讨论】:

  • <article> 类为.entry 的标签具有将页脚向下推的底部边距。您可能需要重组 html 或删除该边距。

标签: html wordpress css footer


【解决方案1】:

删除 .entry 中的边距

.entry {
    margin-bottom: 40px;
}

【讨论】:

    【解决方案2】:

    我刚刚解决了它是正文的边距,所以我从 Opera Inspect 元素复制 CSS 路径,复制到 wordpress(CLASS) 中的 CSS 编辑器并设置边距:0;

    谢谢大家帮忙!

    【讨论】:

      猜你喜欢
      • 2017-05-25
      • 2022-01-18
      • 2014-04-30
      • 1970-01-01
      • 1970-01-01
      • 2017-02-03
      • 2018-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多