html - Div overflowing container div with height: 100%, overflow: hidden breaks scroll-y -
first, fiddle:
https://jsfiddle.net/bsdvc4km/1
i'm having trouble aligning inner div take rest of height of container. can see in fiddle, div "whole" has header attached it, , underneath "content" div. "whole" div overflowing "content" div height 100%, instead of grabbing height of parent "content", grabs height of entire viewport.
<div class="whole"> <div class="left"> </div> <div class="right"> </div> </div>
this container should fitting inside
<div class="content"> <div class="whole"> </div> <div>
the reason there 2 divs, "chrome" , "content", hold left , right divs react app , "chrome" div wrapper around component returns.
if add overflow:hidden "chrome" div, appears solve problem. however, because heights still tall, merely invisible, "right" div, contains bunch of assets intended scrolled through, breaks reach end of div scroll bar it's cut off.
example of this: https://jsfiddle.net/gy1kpxwk/3
so, i'm asking know how make "whole" div not break out of parent, "content" div, , fills rest of space not taken header?
tl;dr make container fill rest of parent container, , not break overflow-y: scroll
in case wants know, using lot of flex boxes fixed problem.
here's codepen /u/bonhone of reddit solved it: http://codepen.io/anon/pen/gpjreq
display: flex; flex-grow: 1;
are magic css lines used. :)
Comments
Post a Comment