Flexbox with full width when forced onto new line - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex

Description

Flexbox with full width when forced onto new line

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.overlay {<!--from w  w w .jav  a  2 s  .c  o m-->
   display:flex;
   flex-wrap:wrap;
   justify-content:stretch;
}

.mainContent {
   flex-grow:2;
   flex-basis:auto;
   min-width:401px;
   margin:6px;
}

.interactions {
   flex-basis:auto;
   flex-grow:2;
   max-width:401px;
   margin:6px;
}

@media only screen and (max-width: 840px) {
   .mainContent, .interactions {
      max-width:none;
      min-width:none;
   }

}
</style> 
 </head> 
 <body> 
  <div class="overlay"> 
   <div class="mainContent" style="border:1px solid">
     Testing 
   </div> 
   <div class="interactions" style="border:1px solid">
     this a test. this a test. this a test. this a test. this a test. this a test. 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials