Skip to content

Commit 38c319f

Browse files
committed
Footer is correctly fixed to the viewport
1 parent 0a9a8f9 commit 38c319f

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

Wireframe/style.css

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
--space: clamp(6px, 6px + 2vw, 15px);
66
--line: 1px solid;
77
--container: 1280px;
8+
--footer-height: 60px;
89
}
910

1011
html,
@@ -21,19 +22,13 @@ body {
2122
system-ui,
2223
-apple-system,
2324
BlinkMacSystemFont,
24-
"Segoe UI",
25-
Roboto,
26-
Oxygen,
27-
Ubuntu,
28-
Cantarell,
29-
"Open Sans",
30-
"Helvetica Neue",
3125
sans-serif;
3226
line-height: normal;
3327

3428
min-height: 100vh;
3529
display: flex;
3630
flex-direction: column;
31+
overflow: hidden;
3732
}
3833

3934
a {
@@ -49,9 +44,8 @@ svg {
4944
}
5045

5146
article img {
52-
height: 240px;
53-
object-fit: cover;
54-
display: block;
47+
height: 20vh;
48+
max-height: 180px;
5549
}
5650

5751
header {
@@ -62,25 +56,28 @@ header {
6256
}
6357

6458
main {
59+
flex: 1;
6560
max-width: var(--container);
6661
margin: 0 auto;
67-
padding-bottom: calc(var(--space) * 4);
68-
69-
flex: 1;
7062
display: grid;
7163
grid-template-columns: 1fr 1fr;
7264
gap: var(--space);
65+
overflow: hidden;
66+
padding-bottom: 60px;
7367
}
7468

7569
main > *:first-child {
7670
grid-column: span 2;
7771
}
7872

7973
footer {
80-
border-top: var(--line);
74+
border-top: none; /* or keep if you want */
8175
padding: var(--space);
8276
text-align: center;
8377
width: 100%;
78+
margin-top: auto;
79+
background: var(--paper);
80+
border-top: 1px solid black;
8481
}
8582

8683
article {

0 commit comments

Comments
 (0)