flexbox - Best practice for splitting viewport with CSS flex -
hoping not nonsense question in way tad non-specific.
it's quite simple - aiming produce design splitting viewport/screen rough halves (60/40) vertically, similar how airbnb do: -
is simple using flexbox columns (i using bootstrap 4), specifying column widths , setting right-hand side column position: fixed?
any advice has welcome have never approached type of design before , want make sure not overlooking anything.
here's flex
layout based solution.
html, body { height: 100%; margin: 0 } .box { display: flex; flex-flow: column; height: 100%; } .box .row { border: 1px dotted grey; } .box .row.header { flex: 0 1 60vh; } .box .row.content { flex: 1 1 40vh; }
<div class="box"> <div class="row header"> <p><b>header</b> (60%)</p> </div> <div class="row content"> <p> <b>content</b> (40%) </p> </div> </div>
Comments
Post a Comment