|
| 1 | +This large example served as the motivational example in the introduction of the spec for a few years. It shows a complex layout using a lot of features, in some cases in a forced way just to include a feature. The example will be replaced in the spec with smaller, more focused examples. |
| 2 | + |
| 3 | +<code css> |
| 4 | +<style> |
| 5 | + #grid { |
| 6 | + width: 80vw; |
| 7 | + height: 110vh; |
| 8 | + grid-template: "aaa.d" |
| 9 | + "....d" |
| 10 | + "bbb.d" |
| 11 | + "....d" |
| 12 | + "ccc.d"; |
| 13 | + grid-template-rows: 52% 4% 20% 4% 20%; |
| 14 | + grid-template-columns: 30% 5% 30% 5% 30%; |
| 15 | + } |
| 16 | + #region1 { grid-cell: a; } |
| 17 | + #region2 { grid-cell: b; } |
| 18 | + #boxA { grid-cell: c; } |
| 19 | + #region3 { grid-cell: d; } |
| 20 | + |
| 21 | + #region4 { |
| 22 | + width: 80vw; |
| 23 | + } |
| 24 | + |
| 25 | + #region2 { |
| 26 | + column-count: 2; |
| 27 | + } |
| 28 | + |
| 29 | + /* |
| 30 | + * Creates the named flow |
| 31 | + */ |
| 32 | + article { |
| 33 | + flow-into: article-flow; |
| 34 | + } |
| 35 | + |
| 36 | + /* |
| 37 | + * Associate it with the intended CSS Regions. |
| 38 | + * This creates a region chain for the named flow. |
| 39 | + */ |
| 40 | + #region1, #region2, #region3, #region4 { |
| 41 | + flow-from: article-flow; |
| 42 | + } |
| 43 | +</style> |
| 44 | +</code> |
| 45 | +<code html> |
| 46 | +<body> |
| 47 | + <!-- |
| 48 | + The following article element is the content |
| 49 | + to flow through the region chain. |
| 50 | + --> |
| 51 | + <article> |
| 52 | + <h1>Introduction</h1> |
| 53 | + <p>This is an example ...</p> |
| 54 | + |
| 55 | + <h2>More Details</h2> |
| 56 | + <p>This illustrates ...</p> |
| 57 | + <p>Then, the example ...</p> |
| 58 | + <p>Finally, this ...</p> |
| 59 | + </article> |
| 60 | +<span |
| 61 | + !-- |
| 62 | + The rest of the markup defines the layout. |
| 63 | + Grid is used in this example, but any method |
| 64 | + for creating boxes could be substituted. |
| 65 | + --> |
| 66 | + <div id="grid"> |
| 67 | + <div id="region1"></div> |
| 68 | + <div id="region2"></div> |
| 69 | + <div id="boxA"></div> |
| 70 | + <content></content> |
| 71 | + <div id="region3"></div> |
| 72 | + </div> |
| 73 | + <div id="region4"></div> |
| 74 | +</body> |
| 75 | + |
| 76 | +</code> |
0 commit comments