html - 为什么我的页脚不在页面底部?

标签 html css wordpress footer

由于某些奇怪的原因,我的页脚显示在我页面内容的后面,不再是正确的高度,我似乎无法修复它。我尝试了其他答案,但都没有用。这个可以查看here.有人有什么想法吗?

.reviewwidget {
	width: 45%;
	margin-bottom: 25px;
	float: left;
}

.reviews {
	width: 55%;
	float:right;
}

.single-review {
	position: relative;
	width:55%;
	float:right;
}

.quotation {
   position: relative; 
   width: 50px; 
   z-index:500;
}

.quotationend {
   position: relative; 
   float:right;
   width: 50px; 
   z-index:400;
   margin-top:-10px;
}

.single-review p {
  position: relative; 
  z-index: 550;
  margin-top: -20px;
  font-size:16px;
  font-style: italic;
}

Footer {
    background-color: #0b1b23;
	color: #ececec;
	padding: 5%;
	font-family: centrale_sans_regularregular, helvetica;
	position:relative;
}

最佳答案

您的 #container 元素有 float 内容,未清除,导致 #container 的高度塌陷。您应该阅读 floating 和 clearfix,但这里有两个解决方案 from this thread :

要添加到 #container 元素的可重用 clearfix 类(推荐):

.clearfix:after { 
   content: " ";
   display: block; 
   height: 0; 
   clear: both;
}

快速而肮脏:

#container { overflow: auto; }

关于html - 为什么我的页脚不在页面底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29198624/

相关文章:

javascript - 如何(取消)关注YouTube的视频元素

带标签的 HTML5 验证表单

php - 将 CSS 与变量 php 结合

php - cURL 不加载样式/css

database - 如何更新自定义 wordpress 表中的行

html - 如何修复 Wordpress 模板中的返回

html - 选项卡内的字形图标大小

jquery - 网站背景图片横向动画无限循环?

javascript - 使用javascript我希望能够获取随机动态变化的字体颜色

html - 元素不可见但仍可在 safari 浏览器上点击