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














