Skip to content

Commit 9c44876

Browse files
Enhance CSS for sticky footer and layout adjustments
1 parent 9abc914 commit 9c44876

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

Wireframe/style.css

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,29 @@
44
left: -9999px;
55
}
66

7-
/* General page styling */
7+
/* General page styling with flexbox for sticky footer */
8+
html, body {
9+
height: 100%;
10+
}
11+
812
body {
913
font-family: Arial, sans-serif;
1014
margin: 0;
15+
padding: 0;
16+
display: flex;
17+
flex-direction: column;
18+
}
19+
20+
/* Make main content flexible to push footer down */
21+
main {
22+
flex: 1;
1123
padding: 20px;
1224
}
1325

1426
/* Center the page title */
1527
header {
1628
text-align: center;
17-
margin-bottom: 20px;
29+
padding: 20px 20px 0;
1830
}
1931

2032
/* Layout for the articles */
@@ -43,10 +55,10 @@ article img {
4355
margin-bottom: 10px;
4456
}
4557

46-
/* Center footer */
58+
/* Fixed footer to bottom of viewport */
4759
footer {
4860
text-align: center;
49-
margin-top: 20px;
50-
padding: 10px;
61+
padding: 10px 20px;
62+
border-top: 1px solid #ccc;
63+
background-color: #f9f9f9;
5164
}
52-

0 commit comments

Comments
 (0)