OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel
="stylesheet"> |
4 <link href="resources/grid.css" rel="stylesheet"> | 5 <link href="resources/grid.css" rel="stylesheet"> |
5 <style> | 6 <style> |
6 .grid { | 7 .grid { |
7 display: grid; | 8 display: grid; |
8 grid-template-rows: repeat(2, 100px); | 9 grid-template-rows: repeat(2, 100px); |
9 grid-template-columns: 100px; | 10 grid-template-columns: 100px; |
10 width: -webkit-fit-content; | |
11 background-color: red; | 11 background-color: red; |
12 } | 12 } |
13 | 13 |
14 .gridItem { | 14 .gridItem { |
15 height: 100%; | 15 height: 100%; |
16 width: 100%; | 16 width: 100%; |
17 background-color: orange; | 17 background-color: orange; |
18 } | 18 } |
19 </style> | 19 </style> |
20 <script> | 20 <script> |
21 function onloadScrollTop() { | 21 function onloadScrollTop() { |
22 // Scroll until we see the grid item's border but not the grid item | 22 // Scroll until we see the grid item's border but not the grid item |
23 window.scrollBy(0,-150); | 23 window.scrollBy(0,-150); |
24 } | 24 } |
25 </script> | 25 </script> |
26 </head> | 26 </head> |
27 <body style="height: 1000px" onload="onloadScrollTop()"> | 27 <body style="height: 1000px" onload="onloadScrollTop()"> |
28 | 28 |
29 <div class="grid"> | 29 <div class="grid fit-content"> |
30 <div class="gridItem" style="grid-column: 1; grid-row: 1; border-bottom: 100px
green solid;"></div> | 30 <div class="gridItem" style="grid-column: 1; grid-row: 1; border-bottom: 100px
green solid;"></div> |
31 </div> | 31 </div> |
32 | 32 |
33 <div>There should be a 100px wide green box (grid item's border) above</div> | 33 <div>There should be a 100px wide green box (grid item's border) above</div> |
34 | 34 |
35 </body> | 35 </body> |
36 <script> | 36 <script> |
37 window.scrollTo(0,300); | 37 window.scrollTo(0,300); |
38 </script> | 38 </script> |
39 </html> | 39 </html> |
OLD | NEW |