Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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 强制容器填充剩余空间_Html_Css_Flexbox - Fatal编程技术网

Html 强制容器填充剩余空间

Html 强制容器填充剩余空间,html,css,flexbox,Html,Css,Flexbox,#wrapper下的div容器.wrapper必须填充页眉和页脚之间的空间。所以它应该得到包装容器的高度 你能帮我吗?因为页眉和页脚有特定的高度,所以简单的方法是执行以下操作: // Add the following to #wrapper #wrapper { position: absolute; top: 200px; left: 0; right: 0; bottom: 200px; // IMPORTANT // REMOVE the foll

#wrapper
下的div容器
.wrapper
必须填充页眉和页脚之间的空间。所以它应该得到包装容器的高度


你能帮我吗?

因为页眉和页脚有特定的高度,所以简单的方法是执行以下操作:

// Add the following to #wrapper

#wrapper {
  position: absolute;
  top: 200px;
  left: 0;
  right: 0;
  bottom: 200px;    
  // IMPORTANT
  // REMOVE the following rule:
  // min-height: 100%;      
}
记住移除
min height:100%来自
#包装器


这是一个例子。祝你好运…

页脚没有特定高度。只有最小高度。这就是问题所在。另外,top 200px也不起作用,因为(sry我忘了说这个)将有一个具有自适应高度的导航栏。我更新了我的问题这有用吗?嗨,我也考虑过使用jquery。我提出了一个类似的解决方案。只要不缩小窗口大小,就可以正常工作。有什么想法吗?