Css div设置为100%不起作用
这是我的网站Css div设置为100%不起作用,css,html,Css,Html,这是我的网站 我试图使菜单标签和colright div具有100%的高度,并将页脚div向下推到底部。但无论我做什么,都没用。我尝试过验证html,但只存在3个错误,这些错误没有那么重要。ami做错了什么?您需要使用(可能与表格单元格一起使用)或。您需要使用(可能与表格单元格一起使用)或。对于这种希望页脚始终出现在窗口底部的情况,我非常喜欢固定布局: header { position: fixed; top: 0; left: 0; width: 100%;
我试图使菜单标签和colright div具有100%的高度,并将页脚div向下推到底部。但无论我做什么,都没用。我尝试过验证html,但只存在3个错误,这些错误没有那么重要。ami做错了什么?您需要使用(可能与
表格单元格一起使用)或。您需要使用(可能与表格单元格一起使用)或。对于这种希望页脚始终出现在窗口底部的情况,我非常喜欢固定布局:
header
{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 130px;
}
nav
{
width: 960px;
margin: 0 auto;
}
article
{
top: 130px;
bottom: 120px;
left: 0;
width: 100%;
position: fixed;
overflow: auto;
}
footer
{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
}
我非常喜欢这种情况下的固定布局,您希望页脚始终显示在窗口底部:
header
{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 130px;
}
nav
{
width: 960px;
margin: 0 auto;
}
article
{
top: 130px;
bottom: 120px;
left: 0;
width: 100%;
position: fixed;
overflow: auto;
}
footer
{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
}