Gid Properties
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 one">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 class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
</body>
</html>
CSS
.container{
width: 600px;
height: 300px;
background-color: rgb(244, 226, 204);
display: grid;
grid-template-rows : repeat(3, 1fr) ;
grid-template-columns: repeat(3 ,1fr) ;
grid-gap:10px 30px ;
/* place-items: center; */
justify-items: start;
align-items: center;
}
.item{
height: 50px;
width: 100px;
border: 2px solid black;
background-color: rgba(255, 0, 0, 0.504);
text-align: center;
padding: 9px;
}
/* .one{
grid-column: 1/3;
grid-row: 1/3 ;
} */
Comments
Post a Comment