File tree 2 files changed +24
-4
lines changed 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 51
51
# new {
52
52
padding-left : 25px ;
53
53
}
54
+
55
+ .grid div {
56
+ width : 100% ;
57
+ height : 100% ;
58
+ }
54
59
</ style >
55
60
< script >
56
61
function randomColor ( ) {
92
97
93
98
addGridItem ( ) ;
94
99
}
100
+
101
+ function updateGridAutoFlow ( ) {
102
+ var grid = document . getElementById ( "grid" ) ;
103
+ var flow = document . getElementById ( "flow" ) ;
104
+
105
+ grid . style . webkitGridAutoFlow = flow . value ;
106
+ grid . style . gridAutoFlow = flow . value ;
107
+ }
95
108
</ script >
96
109
</ head >
97
110
< body >
98
111
< div id ="grid " class ="grid ">
99
112
</ div >
100
113
< div style ="clear: both; "> </ div >
101
114
< div id ="new ">
102
- < h2 > CSS Grid Layout Auto-placement Algorithm</ h2 >
115
+ < h2 > CSS Grid Layout: < a href ="http://dev.w3.org/csswg/css-grid/#auto-placement-algo "> Grid Item Placement Algorithm</ a > </ h2 >
116
+ < p > Property < a href ="http://dev.w3.org/csswg/css-grid/#grid-auto-flow-property "> < code > grid-auto-flow</ code > </ a > is
117
+ < select id ="flow " onchange ="updateGridAutoFlow(); ">
118
+ < option value ="row " selected > row</ option >
119
+ < option value ="column "> column</ option >
120
+ < option value ="row dense "> row dense</ option >
121
+ < option value ="column dense "> column dense</ option >
122
+ </ select >
123
+ </ p >
103
124
< p > New grid item at
104
125
row
105
126
< select id ="row ">
@@ -130,7 +151,6 @@ <h2>CSS Grid Layout Auto-placement Algorithm</h2>
130
151
</ p >
131
152
< button onClick ="addGridItem(); "> Add</ button >
132
153
< button onClick ="addRandomGridItem(); "> Add random</ button >
133
- < p > < a href ="http://www.w3.org/TR/css-grid-1/#auto-placement "> Spec</ a > </ p >
134
154
</ div >
135
155
< table id ="table ">
136
156
< tr >
Original file line number Diff line number Diff line change @@ -235,9 +235,9 @@ <h4 class="list-group-item-heading">Auto-placement Algorithm</h4>
235
235
< a href ="autoplacement.html " class ="label label-primary "> example</ a >
236
236
< a href ="https://github.com/Igalia/css-grid-layout/blob/gh-pages/autoplacement.html " class ="label label-success "> html</ a >
237
237
< a href ="https://github.com/Igalia/css-grid-layout/blob/gh-pages/autoplacement.png " class ="label label-info "> screenshot</ a >
238
- < a href ="http://www .w3.org/TR /css-grid-1 /#auto-placement " class ="label label-warning "> spec</ a >
238
+ < a href ="http://dev .w3.org/csswg /css-grid/#auto-placement-algo " class ="label label-warning "> spec</ a >
239
239
</ p >
240
- < p > Auto-placement algorithm demo. Allow to new add grid items in different positions in order to check how the algorithm works.</ p >
240
+ < p > Auto-placement algorithm demo. Allow to new add grid items in different positions in order to check how the algorithm works. Also, includes the possibitly to change between the different < code > grid-auto-flow </ code > property values. </ p >
241
241
</ li >
242
242
</ ul >
243
243
</ div >
You can’t perform that action at this time.
0 commit comments