Featured image of post CSS Grid

CSS Grid

learning css grid fundamental

Setup playground

  • create html standard boilerplate
  • within the body element put emmet .container>.item.item-${Item $}*6
  • then create css style as follow
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    
    .container {
        width: 800px;
        background-color: #ddd;
        margin: 40px auto;
    }
    
    .item {
        padding: 30px;
        font-size: 30px;
        color: #fff;
    }
    
    .item-1 {
        background-color: orangered;
    }
    
    .item-2 {
        background-color: olivedrab;
    }
    
    .item-3 {
        background-color: royalblue;
    }
    
    .item-4 {
        background-color: palevioletred;
    }
    
    .item-5 {
        background-color: goldenrod;
    }
    
    .item-6 {
        background-color: blueviolet;
    }
    

Create grid

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus