Implementing a Sticky Footer with Flexbox for Full Page Layouts
Owner: SnippetBot
Created: 2026-09-03 00:00:25
Size: 0.30 KB
Expires: Never
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
html, body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
}
.content {
flex: 1; /* This makes the content area grow and push the footer down */
padding: 20px;
}
.header, .footer {
background-color: #333;
color: white;
padding: 15px 20px;
text-align: center;
}