Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は非常に単純なシナリオを持っています
親Div(高さ指定無し)
子 div には一部のコンテンツがあり、高さは 100% に設定されています。
これで、この子 div によって、その親がブラウザ ウィンドウ全体に拡大されます。
よろしくお願いします。
両方に位置を設定します。
#ParentDiv { position:relative; height:auto; } #ChildDiv { position:absolute; /* top/left/right force it to dimensions of parent, if needed */ top:0; left:0; right:0; height:100%; }
親は子供に合うように伸びます。