CSS Grid & Grid Gap

 

Html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="hello.css">
  <title>GRID</title>
</head>
<body>
<h1>Grid Playground</h1>
<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>
</body>
</html>
Css

.container{
    width: 600px;
    height: 300px;
    background-color: rgb(244, 226, 204);
    display: grid;
    grid-template-rows :  auto  ;
    grid-template-columns:  auto auto;
    /* row-gap: 10px;
    column-gap: 30px;
    Shorthand :- */
    grid-gap:10px 30px;

}
.item{
    /* height: 50px;
    width: 100px; */
    border: 2px solid black;
    background-color: chartreuse;
    text-align: center;
    padding: 9px;
   

}

Comments