【发布时间】:2020-05-23 03:03:34
【问题描述】:
我不太明白为什么页脚(和页眉)没有占用所有空间?
我将<body> 部分分为 3 个部分:1) div header,2) div wrapper,3) div footer(这样我就可以分别控制每个部分)。
Div 包装器(应该是窄的)
.wrapper {
display: block;
width: 100%;
max-width: 980px;
margin: 20px auto;
padding: 20px;
border: 1px solid black;}
Div 页脚(在屏幕上应该是 100% 宽)
.footer {
margin: 0px;
padding: 0px;
background-color: black;
height: 200px;
color: orange;
width: 100%;}
我怎样才能让它覆盖所有空间(就像在这个网站上,标题占据了所有空间,但主要内容部分更窄)。
提前谢谢你!
The footer (which is black) doesnt take up all the space and leaves some background
The footer (which is black) doesnt take up all the space and leaves some background
【问题讨论】:
-
html 代码是什么?
-
您很可能会从包含页脚的容器(另一个 div 或 body 本身)中获得填充