Grid Item

grid-column គឺ​ជា property ត្រូវ​គេ​យក​ទៅ​ប្រើប្រាស់​សំរាប់​កំណត់​ចំនួន​ column សំរាប់​ដាក់ item ណា​មួយ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Grid Item</title>
    <style>
      .grid-container {
  		display: grid;
  		grid-template-columns: auto auto auto auto auto auto;
  		grid-gap: 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;
	  }

	  .item1 {
  		grid-column: 1 / span 3;
	  }
    </style>
  </head>
  
  <body>
	

The grid-column Property

Use the grid-column property to specify where to place an item.

Item1 will start on column-line 1 and span 3 columns:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</body> </html>

The grid-column Property

Use the grid-column property to specify where to place an item.

Item1 will start on column-line 1 and span 3 columns:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

ចំណែក​ឯ grid-row ត្រូវ​គេ​យក​ទៅ​ប្រើប្រាស់​សំរាប់​កំណត់​ចំនួន row សំរាប់​ដាក់ item ណា​មួយ​

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Grid Item</title>
    <style>
      .grid-container {
  		display: grid;
  		grid-template-columns: auto auto auto auto auto auto;
  		grid-gap: 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;
	  }

	  .item1 {
  		grid-row: 1 / span 2;
	  }
    </style>
  </head>
  
  <body>
	

The grid-row Property

Use the grid-row property to specify where to place an item.

Item1 will start on row 1 and span 2 rows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</body> </html>

The grid-row Property

Use the grid-row property to specify where to place an item.

Item1 will start on row 1 and span 2 rows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17