Skip to content

Commit 1935fb6

Browse files
committed
Add named grid lines example
1 parent fe7e1db commit 1935fb6

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ <h4 class="list-group-item-heading">Grid areas</h4>
104104
</p>
105105
<p>Example usage of grid areas.</p>
106106
</li>
107+
<li class="list-group-item">
108+
<h4 class="list-group-item-heading">Named grid lines</h4>
109+
<p>
110+
<a href="named-grid-lines.html" class="label label-primary">example</a>
111+
<a href="https://github.com/Igalia/css-grid-layout/blob/gh-pages/named-grid-lines.html" class="label label-success">html</a>
112+
<a href="https://github.com/Igalia/css-grid-layout/blob/gh-pages/named-grid-lines.png" class="label label-info">screenshot</a>
113+
<a href="http://www.w3.org/TR/css-grid/#named-lines" class="label label-warning">spec</a>
114+
</p>
115+
<p>Example usage of named grid lines.</p>
116+
</li>
107117
<li class="list-group-item">
108118
<h4 class="list-group-item-heading"><tt>max-content</tt> and <tt>min-content</tt></h4>
109119
<p>

named-grid-lines.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link href="css/grid.css" rel="stylesheet">
5+
<style>
6+
.grid {
7+
-webkit-grid-template-rows: [top] 100px [main] 1fr [footer] 50px [bottom];
8+
-webkit-grid-template-columns: [left nav] 200px [middle main] 1fr [right];
9+
grid-template-rows: [top] 100px [center] 1fr [footer] 50px [bottom];
10+
grid-template-columns: [left nav] 200px [middle main] 1fr [right];
11+
width: 600px;
12+
height: 400px;
13+
}
14+
15+
#title {
16+
-webkit-grid-row: top;
17+
grid-row: top;
18+
-webkit-grid-column: left / right;
19+
grid-column: left / right;
20+
}
21+
22+
#nav {
23+
-webkit-grid-row: main / bottom;
24+
grid-row: main / bottom;
25+
-webkit-grid-column: nav;
26+
grid-column: nav;
27+
}
28+
29+
#main {
30+
-webkit-grid-row: main;
31+
grid-row: main
32+
-webkit-grid-column: main;
33+
grid-column: main;
34+
}
35+
36+
#footer {
37+
-webkit-grid-row: footer;
38+
grid-row: footer;
39+
-webkit-grid-column: middle;
40+
grid-column: middle;
41+
}
42+
</style>
43+
</head>
44+
<body>
45+
<div class="grid">
46+
<div id="title">title</div>
47+
<div id="nav">nav</div>
48+
<div id="main">main</div>
49+
<div id="footer">footer</div>
50+
</div>
51+
</body>
52+
</html>

named-grid-lines.png

14.5 KB
Loading

0 commit comments

Comments
 (0)