鍍金池/ 問答/HTML5  HTML/ flex伸縮盒子,容器的子項(xiàng)目,子項(xiàng)目里面的內(nèi)容,不管如何都不會(huì)影響子項(xiàng)目嗎?

flex伸縮盒子,容器的子項(xiàng)目,子項(xiàng)目里面的內(nèi)容,不管如何都不會(huì)影響子項(xiàng)目嗎?

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>docuement</title>
<style>
#main {
    width: 800px;
    border: 1px solid #c3c3c3;
    display: flex;
    flex-direction: row;
    position:  absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

#main div {
    width: 50px;
    height: 50px;
}

</style>

</head>
<body>



<div id="main">
  <div style="background-color:coral;width: 100px;flex-grow: 2;">哈哈,哈哈哈哈哈
        <div style="width: 150px;height: 50px;background: red"></div>
  </div>
  <div style="background-color:lightblue;width: 200px;flex-grow: 2;">11111111111111111</div>
  <div style="background-color:khaki;width: 150px;flex-grow: 1;"></div>

</div>

</body>
</html>

我發(fā)現(xiàn)第一個(gè)flex子項(xiàng)目,里面的內(nèi)容div怎么都不會(huì)影響它的高度

回答
編輯回答
拼未來

clipboard.png
你div高度都寫死了,咋影響啊

2017年6月26日 15:46