What is the purpose of a sticky footer in web design?
A sticky footer stays at the bottom of the page even if the content is short, so the footer is always visible at the bottom of the browser window.
Click to reveal answer
beginner
Which Bootstrap utility class helps create a sticky footer by making the page take full height?
The <code>min-vh-100</code> class sets the minimum height of an element to 100% of the viewport height, helping the page fill the screen and push the footer down.
Click to reveal answer
intermediate
How does Flexbox help in creating a sticky footer layout?
Flexbox can make the page container a column that grows to fill the screen, pushing the footer to the bottom when content is short, and letting it move down naturally when content is long.
Click to reveal answer
intermediate
In Bootstrap, which classes are commonly used to make the body a flex container with vertical layout for sticky footer?
Use d-flex flex-column min-vh-100 on the body or main container to create a vertical flex layout that fills the viewport height.
Click to reveal answer
intermediate
Why should you avoid using fixed positioning for sticky footers in responsive design?
Fixed footers can cover content on small screens and do not move with page scroll, which harms usability and accessibility on mobile devices.
Click to reveal answer
Which Bootstrap class sets an element's minimum height to the full viewport height?
Amin-vh-100
Bvh-100
Ch-100
Dfull-height
✗ Incorrect
The min-vh-100 class sets minimum height to 100% of the viewport height, ensuring the element fills the screen vertically.
What CSS layout method is best for creating a sticky footer that adjusts with content height?
AFixed positioning
BGrid
CFloat
DFlexbox
✗ Incorrect
Flexbox allows flexible vertical layouts that push the footer down when content is short and move it naturally when content grows.
Which Bootstrap classes create a vertical flex container that fills the viewport height?
Ad-block flex-wrap vh-100
Bd-inline flex-row h-100
Cd-flex flex-column min-vh-100
Dd-flex flex-row min-vh-50
✗ Incorrect
The combination d-flex flex-column min-vh-100 makes a vertical flex container that fills the screen height.
Why is fixed positioning not recommended for sticky footers on mobile devices?
AIt makes the footer invisible
BIt can cover page content and does not scroll with the page
CIt breaks the page layout completely
DIt disables scrolling on the page
✗ Incorrect
Fixed footers stay in place and can block content behind them, which is bad for usability on small screens.
What role does the flex-grow property play in sticky footer layouts?
AIt makes the main content area expand to fill available space
BIt fixes the footer height
CIt hides the footer when content is short
DIt centers the footer horizontally
✗ Incorrect
flex-grow lets the main content area grow to fill space, pushing the footer to the bottom when content is short.
Explain how to create a sticky footer using Bootstrap and Flexbox.
Think about making the page a vertical flex container that fills the screen.
You got /4 concepts.
Why is a sticky footer important for user experience on pages with little content?
Imagine a short page where the footer is not at the bottom.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of a sticky footer in a web page layout?
easy
A. To make the footer disappear when scrolling down
B. To keep the footer visible at the bottom of the page on all screen sizes
C. To fix the header at the top of the page
D. To center the main content vertically
Solution
Step 1: Understand the sticky footer concept
A sticky footer is designed to stay at the bottom of the page regardless of content height or screen size.
Step 2: Compare options with the concept
Only To keep the footer visible at the bottom of the page on all screen sizes describes this behavior correctly; others describe unrelated features.
Final Answer:
To keep the footer visible at the bottom of the page on all screen sizes -> Option B
Quick Check:
Sticky footer = footer always at bottom [OK]
Hint: Sticky footer means footer stays at bottom always [OK]
Common Mistakes:
Confusing sticky footer with fixed header
Thinking footer hides on scroll
Assuming footer centers content
2. Which Bootstrap utility class helps make the body a flex container for a sticky footer layout?
easy
A. d-flex flex-column min-vh-100
B. text-center bg-primary
C. container-fluid p-3
D. position-fixed bottom-0
Solution
Step 1: Identify flexbox classes for vertical layout
Bootstrap's d-flex flex-column makes the body a vertical flex container, and min-vh-100 ensures full viewport height.
Step 2: Check other options
Options B and C are unrelated styling classes; A fixes position but doesn't create flex layout.
Final Answer:
d-flex flex-column min-vh-100 -> Option A
Quick Check:
Flex column + full height = sticky footer base [OK]
Hint: Use d-flex flex-column min-vh-100 on body [OK]
Common Mistakes:
Using position-fixed instead of flexbox
Confusing padding or text classes with layout
Missing min-vh-100 for full height
3. Given this HTML snippet using Bootstrap classes for sticky footer:
But the footer does not stick to the bottom on short pages. What is missing?
medium
A. The container class on the main
B. The position-fixed class on the footer
C. The min-vh-100 class on the body
D. The text-center class on the footer
Solution
Step 1: Check body height setting
Without min-vh-100, the body height is only as tall as content, so footer won't stick at bottom.
Step 2: Verify other classes
Position-fixed fixes footer but not sticky footer pattern; container and text-center affect layout or style but not footer position.
Final Answer:
The min-vh-100 class on the body -> Option C
Quick Check:
Full viewport height needed for sticky footer [OK]
Hint: Add min-vh-100 to body for full height [OK]
Common Mistakes:
Using position-fixed instead of flexbox height
Adding container but missing height
Confusing text alignment with layout
5. You want a sticky footer that also changes background color when the page content is very short or very tall. Which Bootstrap approach correctly combines sticky footer with responsive background color change?
A. Add bg-light for short pages and bg-dark text-white for tall pages using media queries
B. Add bg-light always and use JavaScript to toggle classes on scroll
C. Use position-fixed bottom-0 on footer and bg-primary class
D. Wrap footer in a container and add bg-success class
Solution
Step 1: Understand sticky footer with background color
The sticky footer uses flexbox with full viewport height. To change background color based on page height, CSS media queries are best.
Step 2: Evaluate options for responsive background
Add bg-light for short pages and bg-dark text-white for tall pages using media queries uses Bootstrap background classes with media queries to switch colors depending on viewport or content height, which is correct.
Step 3: Check other options
Add bg-light always and use JavaScript to toggle classes on scroll uses JavaScript unnecessarily; C breaks sticky footer by fixing position; D only adds static background color.
Final Answer:
Add bg-light for short pages and bg-dark text-white for tall pages using media queries -> Option A
Quick Check:
Use media queries + Bootstrap bg classes for responsive footer [OK]
Hint: Use media queries with Bootstrap bg classes [OK]
Common Mistakes:
Using position-fixed breaks sticky footer
Relying on JavaScript instead of CSS
Adding static background without responsiveness
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.