can i use css grid code example

Example 1: css grid

.container{
	display:grid;
  	place-items:center;
}

//My youtube:'https://www.youtube.com/HasibulIslambd'

Example 2: css grid layout

<!DOCTYPE html>
<html>
<head>
<style>
.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  background-color: #2196F3;
  padding: 10px;
}
.grid-item {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.8);
  padding: 20px;
  font-size: 30px;
  text-align: center;
}
</style>
</head>
<body>

  <div class="grid-container">
    <div class="grid-item">1</div>
    <div class="grid-item">2</div>
    <div class="grid-item">3</div>  
    <div class="grid-item">4</div>
    <div class="grid-item">5</div>
    <div class="grid-item">6</div>  
    <div class="grid-item">7</div>
    <div class="grid-item">8</div>
    <div class="grid-item">9</div>  
  </div>

</body>

Example 3: css grid

.item-a {
  grid-area: header;
}
.item-b {
  grid-area: main;
}
.item-c {
  grid-area: sidebar;
}
.item-d {
  grid-area: footer;
}

.container {
  display: grid;
  grid-template-columns: 50px 50px 50px 50px;
  grid-template-rows: auto;
  grid-template-areas: 
    "header header header header"
    "main main . sidebar"
    "footer footer footer footer";
}

Example 4: css grid example

<!-- HTML code -->
<div class="wrapper">
  <div class="box">A</div><div class="box">B</div><div class="box">C</div>
  <div class="box">D</div><div class="box">E</div><div class="box">F</div>
</div>

<!-- Css code -->
<style>
.wrapper {
  display: grid;
  grid-template-columns: 100px 100px 100px;
  grid-gap: 10px;
  background-color: #fff;
  color: #444;
}
.box {
  background-color: #444;
  color: #fff;
  border-radius: 5px;
  padding: 20px;
  font-size: 150%;
}
</style>

Example 5: grid in ccss

/*
Most Common Grid properties:

display: grid; 
display: inline-grid; for applying inline property on grid
grid-template-rows: 
grid-template-columns: 
grid-auto-flow: dense;
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
justify content
align items

fr = fill up any available space
auto-fit= stretch the cards to fill up the screen 
auto-fill= create extra virtual cards to fill up the screen
*/
.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(auto, 1fr));
  grid-template-rows: repeat(2, 200px);
  grid-gap: 10px;
}

Example 6: css grid

grid-template-rows: 50px 100px 100px

Tags:

Css Example