CSS GRID: Parent & children.

by Rodwyn Moreno

HTML

<section class="wrapper">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>

SCSS

.wrapper {
  border: #000000 solid thin;
  display: grid;
  height: 100vmin;
  width: 100vmin;
  
  
  div {
    color: #FFFFFF;
    text-align: center;
    
    &:nth-child(1) {
      background: #FF1A1A;
    }

    &:nth-child(2) {
      background: #009999;
    }
    
    &:nth-child(3) {
      background: #FF9900;
    }
    
    &:nth-child(4) {
      background: #CC66FF;
    }
    
    &:nth-child(5) {
      background: #00FF99;
    }
    
    &:nth-child(6) {
      background: #FFFF33;
    }
  }
}