Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html css最小宽度和最小高度不工作_Html_Wrapper_Css - Fatal编程技术网

Html css最小宽度和最小高度不工作

Html css最小宽度和最小高度不工作,html,wrapper,css,Html,Wrapper,Css,我正在重新设计我的网站,而现在我只是把布局弄得一团糟。我有一个以一切为中心的课程: .centre { position:absolute; left:50%; top:50%; } 然后使用边距对所有内容进行偏移 我有一个包装,它给出了最小高度和最小宽度 #wrapper { position:relative; left:0px; top:0px; min-height:600px; min-width:600px; } 最小宽度和最小高度都起作用,但由于某种原因,应用此包装后,网站不再

我正在重新设计我的网站,而现在我只是把布局弄得一团糟。我有一个以一切为中心的课程:

.centre
{
position:absolute;
left:50%;
top:50%;
}
然后使用边距对所有内容进行偏移

我有一个包装,它给出了最小高度和最小宽度

#wrapper {
position:relative;
left:0px;
top:0px;
min-height:600px;
min-width:600px;
}
最小宽度和最小高度都起作用,但由于某种原因,应用此包装后,网站不再垂直居中。 您可以在此处查看网站:

我想知道这是什么原因,解决办法是什么。
谢谢

Dillon Brannick。

您的问题是页面的正文没有垂直填充整个浏览器窗口。你可以通过使用Firebug并将身体元素悬停来检查这一点——不是整个浏览器窗口都会变成蓝色

尝试使用以下CSS修复此问题:

html, body
{
    height: 100%;
}

您的问题是页面的正文没有垂直填充整个浏览器窗口。你可以通过使用Firebug并将身体元素悬停来检查这一点——不是整个浏览器窗口都会变成蓝色

尝试使用以下CSS修复此问题:

html, body
{
    height: 100%;
}

这没有效果,直到我在包装纸上加上高度:100%。这两种方法都需要,虽然不太清楚为什么会起作用,但似乎是这样。这没有效果,直到我在包装纸上加上高度:100%。这两种方法都需要,虽然不能确定为什么会起作用,但似乎确实如此。