html - Container not expanding height to fit content -


i tried work flexboxes having trouble it.

this how should look.

as display small, content either overflows nested flexbox or (while tried fix myself) nested flexbox overflows main flexbox.

bug

html,  body,  .viewport {    width: 100%;    height: 100%;    margin: 0;    font-family: 'open sans', sans-serif;    font-size: 11pt;  }    body {    display: -webkit-flex;    display: flex;    -webkit-flex-direction: column;    flex-direction: column;  }    header,  article,  section,  footer {    padding: 2em;  }    header {    background-color: red;  }    article {    background-color: aqua;    -webkit-flex: 1;    flex: 1;  }    section {    background-color: yellow;    display: flex;    flex-direction: row;    flex-grow: 1;  }    .offer {    background-color: cornflowerblue;    border: 1px solid black;  }    footer {    background-color: forestgreen;  }
<header>    header  </header>  <article>    article  </article>  <section>    <div class="offer">orem ipsum dolor sit amet, consectetuer adipiscing elit. aenean commodo ligula eget dolor. aenean massa. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. donec quam felis, ultricies nec, pellentes</div>    <div class="offer">o2</div>    <div class="offer">o3</div>  </section>  <footer>    footer  </footer>

i'm not sure if looking for, add "flex-wrap: wrap; " .section (yellow background). cause boxes stack vertically when don't have enough space, , keep of content inside of correct borders. default setting wrapping no wrap, why content squishing that.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -