-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.html
More file actions
69 lines (67 loc) · 1.46 KB
/
Copy path4.html
File metadata and controls
69 lines (67 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Define your grid system</title>
<style>
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-gap: 3px;
margin-bottom: 3px
}
.col-2 {
grid-column: 1 / span 2;
}
.col-3 {
grid-column: 1 / span 3;
}
.col-4 {
grid-column-end: span 4;
}
.push-1 {
grid-column-start: 2;
}
.items {
padding: 20px;
background: #dedede;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="items">1 column</div>
</div>
<div class="container">
<div class="items col-2">2 columns</div>
</div>
<div class="container">
<div class="items col-3">3 columns</div>
</div>
<div class="container">
<div class="items col-4 push-1">4 columns starts from second element</div>
</div>
<pre>
Sass code to generate 12 grid columns.
<code>
@for $i from 1 through 12 {
.col-#{$i} {
grid-column-start: 1;
grid-colimn-end: #{$i};
}
}
</code>
<code>
@for $i from 1 through 11 {
.push-#{$i} {
grid-column-start: #{$i};
}
}
</code>
</pre>
<p><a href="https://www.sassmeister.com/" target="_blank">See the generated code</a></p>
</body>
</html>