|
9 | 9 | "code": [
|
10 | 10 | "<!DOCTYPE html>",
|
11 | 11 | "<html style=\"margin: 0\">",
|
12 |
| - " <head></head>", |
| 12 | + " <head>", |
| 13 | + " <style type=\"text/css\">", |
| 14 | + " body {", |
| 15 | + " margin: 0;", |
| 16 | + " display: flex;", |
| 17 | + " flex-direction: column;", |
| 18 | + " min-height: 100svh; /* Smallest viewport height */", |
| 19 | + " min-height: 100vh; /* Standard viewport height */", |
| 20 | + " min-height: 100dvh; /* Dynamic viewport height */", |
| 21 | + " min-height: 100lvh; /* Largest viewport height */", |
| 22 | + " background-color: red;", |
| 23 | + " }", |
| 24 | + "", |
| 25 | + " .header {", |
| 26 | + " position: sticky;", |
| 27 | + " top: 0;", |
| 28 | + " left: 0;", |
| 29 | + " right: 0;", |
| 30 | + " background-color: blue;", |
| 31 | + " }", |
| 32 | + "", |
| 33 | + " .body {", |
| 34 | + " flex-grow: 1;", |
| 35 | + " background-color: whitesmoke;", |
| 36 | + " }", |
| 37 | + "", |
| 38 | + " .footer {", |
| 39 | + " position: sticky;", |
| 40 | + " bottom: 0;", |
| 41 | + " left: 0;", |
| 42 | + " right: 0;", |
| 43 | + " background-color: blue;", |
| 44 | + " }", |
| 45 | + " </style>", |
| 46 | + " <head>", |
13 | 47 | " <body>",
|
14 | 48 | " <div class=\"header\">header</div>",
|
15 | 49 | " <div class=\"body\">body/content</div>",
|
16 | 50 | " <div class=\"footer\">footer</div>",
|
17 | 51 | " </body>",
|
18 |
| - " <style type=\"text/css\">", |
19 |
| - " body {", |
20 |
| - " margin: 0;", |
21 |
| - " display: flex;", |
22 |
| - " flex-direction: column;", |
23 |
| - " min-height: 100svh; /* Smallest viewport height */", |
24 |
| - " min-height: 100vh; /* Standard viewport height */", |
25 |
| - " min-height: 100dvh; /* Dynamic viewport height */", |
26 |
| - " min-height: 100lvh; /* Largest viewport height */", |
27 |
| - " background-color: red;", |
28 |
| - " }", |
29 |
| - "", |
30 |
| - " .header {", |
31 |
| - " position: sticky;", |
32 |
| - " top: 0;", |
33 |
| - " left: 0;", |
34 |
| - " right: 0;", |
35 |
| - " background-color: blue;", |
36 |
| - " }", |
37 |
| - "", |
38 |
| - " .body {", |
39 |
| - " flex-grow: 1;", |
40 |
| - " background-color: whitesmoke;", |
41 |
| - " }", |
42 |
| - "", |
43 |
| - " .footer {", |
44 |
| - " position: sticky;", |
45 |
| - " bottom: 0;", |
46 |
| - " left: 0;", |
47 |
| - " right: 0;", |
48 |
| - " background-color: blue;", |
49 |
| - " }", |
50 |
| - " </style>", |
51 | 52 | "</html>"
|
52 | 53 | ],
|
53 | 54 | "tags": ["html", "css", "layout", "sticky", "flexbox", "viewport"],
|
|
0 commit comments