gpt4 book ai didi

html - CSS页脚无法调整高度

转载 作者:太空宇宙 更新时间:2023-11-03 23:43:10 25 4
gpt4 key购买 nike

我正在尝试创建一个页面,我想调整页脚的高度。但是我失败了。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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com