HTML CSS examples for CSS Layout:Layout
Auto-size the left and the right divs in a three-div layout
<html> <head> <title>Lorem ipsum dolor sit amet, co</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!--from w w w. java 2s . c o m--> display:flex; } .container .grid1 { background-color:Chartreuse; flex:2; } .container .grid2 { background-color:yellow; width:71px; } </style> </head> <body> <div class="container"> <div class="grid1"> Lorem </div> <div class="grid2"> Lorem <br>Lorem ipsum dolor sit a <br>Lorem ipsum </div> <div class="grid1"> Lorem </div> </div> </body> </html>