Grid Container

grid layout គឺ​ជា​បច្ចេកទេស​តំរៀប​ element មួយ​ចំនួន​នៅ​ក្នុង​ក្រឡាចត្រង្គ​ឬ​ក្រឡា​សំណាញ់ (grid) ​របស់​ element ​ណា​មួយ​ទៀត​ ដែល​ផ្ទៃ​របស់​វា​ត្រូវ​បាន​បែង​ចែក​ជា​ក្រឡា​ចត្រង្គ​ឬ​ក្រឡា​សំណាញ់ ដោយ​ property display ។ ពិនិត្យ​កូដ​ខាង​ក្រោម​នេះ៖

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Grid Container</title>
    <style>
      .grid-container {
  		display: grid;
  		grid-template-columns: auto auto auto auto;
  		grid-gap: 20px 10px;
  		background-color: #2196F3;
  		padding: 10px;
	  }

	  .grid-container > div {
  		background-color: rgba(255, 255, 255, 0.8);
  		text-align: center;
  		padding: 20px 0;
  		font-size: 30px;
	  }
    </style>
  </head>
  
  <body>
	

grid-template-columns

You can use the grid-template-columns property to specify the number of columns in your grid layout.

1
2
3
4
5
6
7
8
</body> </html>

grid-template-columns

You can use the grid-template-columns property to specify the number of columns in your grid layout.

1
2
3
4
5
6
7
8