| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>CSS3 Grid Layout: Flexible Lenght</title> |
| 5 <link rel="author" title="swain" href="mailto:swainet@126.com"/> |
| 6 <link rel="reviewer" title="Dayang Shen" href="mailto:shendayang@baidu.com"/>
<!-- 2013-09-22 --> |
| 7 <link rel="help" href="http://www.w3.org/TR/css-grid-1/#fr-unit"/> |
| 8 <link rel="match" href="../reference/fr-unit-with-percentage-ref.html"> |
| 9 <style type="text/css"> |
| 10 #container { |
| 11 position:relative; |
| 12 width:400px; |
| 13 height:100px; |
| 14 } |
| 15 |
| 16 #grid { |
| 17 display:grid; |
| 18 grid-template-columns:1fr 75%; |
| 19 grid-template-rows:1fr 70%; |
| 20 width:100%; |
| 21 height:100%; |
| 22 } |
| 23 |
| 24 #cell1 { |
| 25 grid-column:1; |
| 26 grid-row:1; |
| 27 } |
| 28 |
| 29 #cell2 { |
| 30 grid-column:2; |
| 31 grid-row:1; |
| 32 } |
| 33 |
| 34 #cell3 { |
| 35 grid-column:1; |
| 36 grid-row:2; |
| 37 height:100%; |
| 38 } |
| 39 |
| 40 #cell4 { |
| 41 grid-column:2; |
| 42 grid-row:2; |
| 43 background-color:green; |
| 44 height:100%; |
| 45 } |
| 46 |
| 47 .error { |
| 48 position:absolute; |
| 49 top:0; |
| 50 left:0; |
| 51 height:100%; |
| 52 width:100%; |
| 53 z-index:-1; |
| 54 } |
| 55 |
| 56 #table { |
| 57 width:100%; |
| 58 height:100%; |
| 59 border-collapse:collapse; |
| 60 } |
| 61 |
| 62 #table td { |
| 63 padding:0; |
| 64 vertical-align:top; |
| 65 } |
| 66 |
| 67 #table td:first-child { |
| 68 width:100px; |
| 69 } |
| 70 |
| 71 #table tr:first-child td { |
| 72 height:30px; |
| 73 } |
| 74 </style> |
| 75 </head> |
| 76 <body> |
| 77 <p>Test passes if there is a green square and no red.</p> |
| 78 |
| 79 <div id="container"> |
| 80 <div id="grid"> |
| 81 <div id="cell1">cell1</div> |
| 82 <div id="cell2">cell2</div> |
| 83 <div id="cell3">cell3</div> |
| 84 <div id="cell4">cell4</div> |
| 85 </div> |
| 86 <div class="error"> |
| 87 <table id="table"> |
| 88 <tbody> |
| 89 <tr> |
| 90 <td> </td> |
| 91 <td> </td> |
| 92 </tr> |
| 93 <tr> |
| 94 <td> </td> |
| 95 <td style="background-color:red"> </td> |
| 96 </tr> |
| 97 </tbody> |
| 98 </table> |
| 99 </div> |
| 100 </div> |
| 101 </body> |
| 102 </html> |
| OLD | NEW |