GridNotes / By nukeama Grid is layout system which is available in CSS. In this note i just record some GRID Tutorial for my needs <div class="container"> <div class="item"> </div> <div class="item"> </div> <div class="item"> </div> </div> <style> .container { display: grid; } .item { margin:10px 0; background-color:#ff00ff; width:300px; height:100px; } </style> View Demo <div class="container"> <div class="item">1 </div> <div class="item">2 </div> <div class="item">3 </div> <div class="item">4 </div> <div class="item">5 </div> <div class="item">6 </div> </div> <style> .container { display: grid; grid-template-columns: 90px 50px 120px; grid-template-rows: 90px 50px 120px; grid-gap:20px; } .item { background-color:#ff00ff; } </style> View Demo <div class="container"> <div class="item">1 </div> <div class="item">2 </div> <div class="item">3 </div> <div class="item">4 </div> <div class="item">5 </div> <div class="item">6 </div> </div> <style> .container { display: grid; grid-template-columns: 1fr 1fr 2fr; grid-template-rows: 2fr 1fr 2fr; grid-gap:20px; } .item { background-color:#ff00ff; } </style> View Demo <!DOCTYPE html> <html> <head> <style> .item1 { grid-area: myArea; } .item4 { grid-area: myAreaB; } .item9 { grid-area: myAreaC; } .grid-container { display: grid; grid-template-areas: 'myArea myArea myAreaB myAreaC .'; grid-gap: 10px; background-color: #2196F3; padding: 10px; } .grid-container > div { background-color: rgba(255, 255, 255, 0.8); text-align: center; padding: 20px 0; font-size: 30px; } </style> </head> <body> <h1>The grid-template-areas Property</h1> <p>You can use the <em>grid-template-areas</em> property to set up a grid layout.</p> <p>Item1, is called "myArea" and will take up the place of two columns (out of five):</p> <div class="grid-container"> <div class="item1">1</div> <div class="item2">2</div> <div class="item3">3</div> <div class="item4">4</div> <div class="item5">5</div> <div class="item6">6</div> <div class="item7">7</div> <div class="item8">8</div> <div class="item9">9</div> </div> </body> </html> View Demo <!DOCTYPE html> <html> <head> <style> .item1 { grid-area: A; } .item2 { grid-area: B; } .item3 { grid-area: C; } .item4 { grid-area: D; } .item5 { grid-area: E; } .item6 { grid-area: F; } .grid-container { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; grid-template-areas: 'A A A B B C' 'A A A B B C' 'A A A D D C' 'E E E D D C' 'E E E . . C' 'F F F F F F'; grid-gap: 10px; background-color: #2196F3; padding: 10px; } .grid-container > div { background-color: rgba(255, 255, 255, 0.8); text-align: center; padding: 20px 0; font-size: 30px; } </style> </head> <body> <h1>The grid-template-areas Property</h1> <p>You can use the <em>grid-template-areas</em> property to set up a grid layout.</p> <p>Item1, is called "myArea" and will take up the place of two columns (out of five):</p> <div class="grid-container"> <div class="item1">1</div> <div class="item2">2</div> <div class="item3">3</div> <div class="item4">4</div> <div class="item5">5</div> <div class="item6">6</div> </div> </body> </html> View Demo