css - Column flexbox fitting within another column flexbox -
css - Column flexbox fitting within another column flexbox -
i'm trying ui looks this:
in image pretend top bar "new york..." , "book it" button fixed , stuff between scrollable.
the html have far (note .button , .form divs seek maintain illustration simple possible)
<div class="wrapper"> <div class="sidebar"> <!-- hidden ui unless swipe left right --> </div> <div class="inner-wrapper"> <div class="header">title here</div> <div class="balance-bar">$0</div> <div class="app-content"> <div class="body-content"> <div class="form"> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> </div> <div class="button">submit</div> </div> </div> </div> </div>
the css is:
.button, input { width:100%; box-sizing: border-box; } .wrapper { border: 2px solid blue; height:200px; overflow: auto; } .header { background: lightblue; flex-shrink: 0; } .balance-bar { background: lightgreen; flex-shrink: 0; } .inner-wrapper { border: 2px solid red; display: flex; flex-direction: column; } .app-content { border: 2px solid green; overflow:auto; } .body-content { border: 2px solid orange; display: flex; flex-direction:column; } .form { } .button { background: pink; flex-shrink: 0; }
if move button outside form , kid of first flexbox (so .button sibling of .app-content) works great , don't need flexbox within flexbox. 1 flexbox works perfect. issue tho semantics wrong, don't built in browser features come in submit, , flow js work super janky.
i hoping flexbox can set wrapper height of window , flexbox calculate children fit within window (which does, not children set flex)
http://jsbin.com/gumozexihi/1/edit?html,css,output
css css3 layout flexbox
Comments
Post a Comment