grid-max-sizing-flex-002.html (2463B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html><head> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: Testing track flex max-sizing</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151212"> 10 <link rel="help" href="http://dev.w3.org/csswg/css-grid/#algo-flex-tracks"> 11 <link rel="match" href="grid-max-sizing-flex-002-ref.html"> 12 <style type="text/css"> 13 body,html { color:black; background:white; font-size:16px; padding:0; margin:0; } 14 15 body { width: 800px; } 16 .grid { 17 display: grid; 18 grid-auto-columns: minmax(0,1fr); 19 border: dashed blue; 20 justify-items: stretch; 21 } 22 23 .c1 { grid-column: 1 / span 2; min-width:40px; } 24 .r1 { grid-column: 2 / span 3; min-width:70px; } 25 .c3 { grid-column: 3 / span 1; min-width:0; } 26 27 span { 28 background: gray; 29 border-style: solid; 30 border-width: 1px 3px 5px 7px; 31 padding: 1px 3px; 32 margin: 1px 5px; 33 } 34 35 x { display:inline-block; width:10px; height:18px; } 36 </style> 37 </head> 38 <body> 39 40 <div class="grid"> 41 <span class="c1"><x></x></span> 42 <span class="r1"><x></x></span> 43 </div> 44 45 <div class="grid"> 46 <span class="c1"><x></x></span> 47 <span class="r1"><x></x></span> 48 <span class="c3"><x></x></span> 49 </div> 50 51 <div class="grid"> 52 <span class="c1"><x></x></span> 53 <span class="r1"><x></x></span> 54 <span class="r1"><x></x></span> 55 <span class="r1"><x></x></span> 56 </div> 57 <div class="grid" style="grid-template-columns: minmax(0,1fr) 400px;"> 58 <span class="c1"><x></x></span> 59 <span class="r1"><x></x></span> 60 <span class="c3"><x></x></span> 61 </div> 62 63 <div class="grid" style="width:500px;"> 64 <span class="c1" style="min-width:20px"><x></x></span> 65 <span class="r1" style="min-width:10px"><x></x></span> 66 <span class="r1" style="min-width:30px"><x></x></span> 67 <span class="r1" style="min-width:10px"><x></x></span> 68 </div> 69 70 <div class="grid" style="grid-template-columns: minmax(0,1fr) minmax(0,500px);"> 71 <span class="c1"><x></x></span> 72 <span class="r1"><x></x></span> 73 <span class="c3"><x></x></span> 74 </div> 75 76 <div class="grid"> 77 <span class="c1" style="width:100px"><x></x></span> 78 <span class="r1" style="width:300px"><x></x></span> 79 <span class="c3"><x></x></span> 80 </div> 81 82 <div class="grid"> 83 <span class="c1" style="width:100px; border-sizing:border-box"><x></x></span> 84 <span class="r1" style="width:300px; border-sizing:border-box"><x></x></span> 85 <span class="c3"><x></x></span> 86 </div> 87 88 </body> 89 </html>