Make a flexbox parent to have the width of its children - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Width

Description

Make a flexbox parent to have the width of its children

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>

.parent {<!--  w w w . ja  va2 s.  com-->
   display: inline-flex;
   background-color: #777;
}


      </style> 
 </head> 
 <body translate="no"> 
  <div class="parent"> 
   <div class="child">
     one 
   </div> 
   <div class="child">
     two 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials