html - CSS页脚无法调整高度

标签 html css footer

我正在尝试创建一个页面,我想调整页脚的高度。但是我失败了。 div#F {background:yellow;height: 40px} <--height 不起作用。请帮忙!

<html>
<head>
<style type="text/css">
div#C {margin:auto; width:1200px; height:830px} 
div#H {background:pink;}
div#Menu {background:pink;}
div#A {float: left; width:80%; background:red; height:700px} 
div#B {float: right; width: 20%; background:green;height:700px}
div#F {background:yellow;height: 40px}
</style>
<title></title>
</head>
<body>
<div id="C">
<div id="H">
</div>
<div style="height: 35px;" id="Menu">Menu</div>
<div id="A">Left floating div</div>
<div id="B">Right floating div</div>
<div id="F">Footer</div>
</div>
</body>
</html>

最佳答案

在页脚处添加清除。

DEMO

   div#F {clear:both;background:yellow;height: 40px}

关于html - CSS页脚无法调整高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22241636/

相关文章:

css - 防止 anchor 标记改变样式

jquery - 遍历 div 并检查第一个元素是否强

html - 图像和 div 的 Z 索引

css - 等价于 XPath 中的 CSS 多重选择器

html - 框架集在 IE 中不工作

javascript - 为什么这个计算不正确?

android - 从 Android Studio 的 url 注入(inject) CSS

jquery - 页脚没有停留在页面底部

html - 新手 HTML5 和 CSS3 问题与定位一些图标

android:如何将节页脚添加到列表