|
50 | 50 | box-sizing: border-box;
|
51 | 51 | }
|
52 | 52 | </style>
|
53 |
| - |
| 53 | + <link rel="stylesheet" href="lib/prism/themes/prism.css"> |
| 54 | + <script src="lib/prism/prism.js"></script> |
| 55 | + <script src="lib/prism/plugins/normalize-whitespace/prism-normalize-whitespace.js"></script> |
54 | 56 | </head>
|
55 | 57 |
|
56 | 58 | <body>
|
@@ -80,11 +82,56 @@ <h2>University Footer</h2>
|
80 | 82 |
|
81 | 83 | <h2>Sticky Footer</h3>
|
82 | 84 | <p>We strongly recommend adding some code to make the footer "stick" to the bottom of the window
|
83 |
| - even when there is little or no page content. Unfortunately due to some of the limitations |
84 |
| - of web components this can't be built into the footer component, but an example of how to |
85 |
| - do this can be found here on the docs home page: <a href="index.html#sticky-footer">Docs Home Page</a></p> |
| 85 | + even when there is little or no page content. Unfortunately due to some of the limitations |
| 86 | + of web components this can't be built into the footer component. However, you can do this with |
| 87 | + flexbox as follows: |
| 88 | + <ul> |
| 89 | + <li>The byu-header, page-content div, and byu-footer should all be children of the same containing element</li> |
| 90 | + <li>The containing element should be have the styles <code>height: 100%</code>, <code>display: flex</code>, and <code>flex-direction: column</code></li> |
| 91 | + <li>The page-content div should have a style of <code>flex-grow: 1</code></li> |
| 92 | + <li>The height of any ancestors of the containing element should also be set to 100%.</li> |
| 93 | + </ul> |
| 94 | + </p> |
| 95 | + |
| 96 | + Here's a simple example: |
| 97 | + |
| 98 | + <pre><code class="language-html"> |
| 99 | + <style> |
| 100 | + html, body { |
| 101 | + height: 100%; |
| 102 | + } |
| 103 | + |
| 104 | + containing-element { |
| 105 | + display: flex; |
| 106 | + flex-direction: column; |
| 107 | + height: 100%; |
| 108 | + } |
| 109 | + |
| 110 | + .page-content { |
| 111 | + flex-grow: 1; |
| 112 | + } |
| 113 | + </style> |
| 114 | + |
| 115 | + <html> |
| 116 | + <body> |
| 117 | + <div class="containing-element"> |
| 118 | + |
| 119 | + <byu-header> |
| 120 | + <h1 slot="site-title">Your Site Title Here</h1> |
| 121 | + </byu-header> |
| 122 | + |
| 123 | + <div class="page-content"> |
| 124 | + <!-- Put your site content here --> |
| 125 | + </div> |
| 126 | + |
| 127 | + <byu-footer></byu-footer> |
86 | 128 |
|
| 129 | + </div> |
| 130 | + </body> |
| 131 | + </html> |
87 | 132 |
|
| 133 | + </code></pre> |
| 134 | + |
88 | 135 | <h2>Site Footer</h2>
|
89 | 136 | <p>
|
90 | 137 | Some sites may need to embed their own links and content in the footer. You can accomplish this by placing
|
|
0 commit comments