1+ <!doctype html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > CSS Cookbook: Grid Wrapper</ title >
7+ < link rel ="stylesheet " href ="styles.css ">
8+ < style >
9+ .grid {
10+ display : grid;
11+ grid-template-columns : minmax (20px , 1fr ) repeat (6 , minmax (0 , 60px )) minmax (20px , 1fr );
12+ grid-auto-rows : minmax (100px , auto);
13+ grid-gap : 10px ;
14+ }
15+
16+ .grid > * {
17+ border : 2px solid rgb (95 , 97 , 110 );
18+ border-radius : .5em ;
19+ padding : 20px ;
20+ }
21+
22+ .full-width {
23+ grid-column : 1 / -1 ;
24+ }
25+
26+ .wrapper {
27+ grid-column : 2 / -2 ;
28+ }
29+
30+ .left-edge {
31+ grid-column : 1 / -2 ;
32+ }
33+
34+ .right-wrapper {
35+ grid-column : 4 / -2 ;
36+ }
37+ </ style >
38+
39+ < style class ="editable ">
40+ .grid {
41+ display : grid;
42+ grid-template-columns : minmax (20px , 1fr ) repeat (6 , minmax (0 , 60px )) minmax (20px , 1fr );
43+ grid-gap : 10px ;
44+ }
45+
46+ .full-width {
47+ grid-column : 1 / -1 ;
48+ }
49+
50+ .wrapper {
51+ grid-column : 2 / -2 ;
52+ }
53+
54+ .left-edge {
55+ grid-column : 1 / -2 ;
56+ }
57+
58+ .right-wrapper {
59+ grid-column : 4 / -2 ;
60+ }
61+ </ style >
62+ </ head >
63+
64+ < body >
65+ < section class ="preview ">
66+ < div class ="grid ">
67+ < div class ="wrapper ">
68+ < p > This item aligns to a central “wrapper” – columns that have a maximum width.</ p >
69+ </ div >
70+ < div class ="full-width ">
71+ < p > This item aligns to the edge of the grid container.</ p >
72+ </ div >
73+ < div class ="left-edge ">
74+ < p > This item aligns to the left edge of the grid container and the right edge of the wrapper.</ p >
75+ </ div >
76+ < div class ="right-wrapper ">
77+ < p > This item aligns to the right edge of the “wrapper” columns.</ p >
78+ </ div >
79+ </ div >
80+ </ section >
81+
82+ < textarea class ="playable playable-css " style ="height: 170px; ">
83+ .grid {
84+ display: grid;
85+ grid-template-columns: minmax(20px, 1fr) repeat(6, minmax(0, 60px)) minmax(20px, 1fr);
86+ grid-gap: 10px;
87+ }
88+
89+ .full-width {
90+ grid-column: 1 / -1;
91+ }
92+
93+ .wrapper {
94+ grid-column: 2 / -2;
95+ }
96+
97+ .left-edge {
98+ grid-column: 1 / -2;
99+ }
100+
101+ .right-wrapper {
102+ grid-column: 4 / -2;
103+ }
104+ </ textarea >
105+
106+ < textarea class ="playable playable-html " style ="height: 70px; ">
107+ < div class ="grid ">
108+
109+ < div class ="wrapper ">
110+ < p > This item aligns to a central “wrapper” – columns that have a maximum width.</ p >
111+ </ div >
112+
113+ < div class ="full-width ">
114+ < p > This item aligns to the edge of the grid container.</ p >
115+ </ div >
116+
117+ < div class ="left-edge ">
118+ < p > This item aligns to the left edge of the grid container and the right edge of the wrapper.</ p >
119+ </ div >
120+
121+ < div class ="right-wrapper ">
122+ < p > This item aligns to the right edge of the “wrapper” columns.</ p >
123+ </ div >
124+
125+ </ div >
126+ </ textarea >
127+
128+ <!-- leave everything below here alone -->
129+ < div class ="playable-buttons ">
130+ < input id ="reset " type ="button " value ="Reset ">
131+ </ div >
132+ </ body >
133+ < script src ="playable.js "> </ script >
134+
135+ </ html >
0 commit comments