Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.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 flex容器100%高度的Bug?_Html_Css_Flexbox - Fatal编程技术网

Html flex容器100%高度的Bug?

Html flex容器100%高度的Bug?,html,css,flexbox,Html,Css,Flexbox,请看jsbin。 我在flex容器上有一些100%高度的bug。当内容太多时,它会从您忘记创建/打开的容器中掉落 <div class="col col2"> <div class="col col1"> </div> place <div class="col col2"> after the ending div of col col1 html,body{ height:100%; /*Having 100% stretches

请看jsbin。


我在flex容器上有一些100%高度的bug。当内容太多时,它会从您忘记创建/打开的容器中掉落

<div class="col col2"> 
<div class="col col1">
</div> place <div class="col col2"> after the ending div of col col1
html,body{
  height:100%; /*Having 100% stretches your content, try removing height:100%; and see the difference*/
}

.parent{
  padding:10px;
  background:#888;
  display:flex;
  flex-wrap:wrap; /*Using flex-wrap:wrap will wrap your second div class to the next line*/
  flex:1 0 auto;
}

.col1{
  background:yellow;
}

.col2{
  background:lightgreen;
}