hello i am working in an web applications when i want to put the grid on the center my code not work and the grid still on the same place , this is what i tried, i am stuck with it and i did many way but this that i want i cant get it any help please ?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.grid-container {
display: grid;
grid-template-columns: auto auto
auto;
grid-gap: 2px;
background-color: #2196F3;
padding: 2px;
}
.items {
background-color: rgba(255, 255,
255, 0.8);
text-align: center;
padding: 40px 0;
}
.item1 {
grid-column-start: 1;
grid-column-end: 3;
background-color: orange;
}
.item2{
grid-column-start: 3;
grid-column-end: 4;
background-color: orange;
}
.item3{
grid-row-start: 2;
grid-row-end: 4;
background-color:#dfe11b;
}
.item4{
grid-column-start: 2;
grid-column-end: 4;
background-color:#e11b93
}
.item5{
grid-column-start: 2;
grid-column-end: 4;
background-color:#e11b93
}
.item6{
background-color:#0872d4
}
.item7{
background-color:#0872d4
}
.item8{
background-color:#0872d4
}
.Body{
margin: 0;
height: 100vh;
display: flex;
align-items:center;
justify-content:center;
}
</style>
<title>griad</title>
</head>
<body>
<div class="grid-container">
<div class="item1 items"></div>
<div class="item2 items"></div>
<div class="item3 items"></div>
<div class="item4 items"></div>
<div class="item5 items"></div>
<div class="item6 items"></div>
<div class="item7 items"></div>
<div class="item8 items"></div>
</div>
</body>
</html>
and this is what i want: