Comments (1)
Off the top of my head, there are three pretty solid approaches to solving the so-called “Sticky Footer” problem, to which I assume you’re referring:
- Use flexbox. One advantage of this method is that it works for a footer with arbitrarily contents. One potential disadvantage is that some have warned about performance issues with using flexbox for page layouts.
- Set
html, body { height: 100vh }
, absolutely position the footer, and add space below the content (apply a fixed padding, render a pseudo-element with a fixed height, etc.) which matches the height of the footer contents (demo). This has the downside of duplicating the knowledge of footer content to spacer height. It is however a very simple solution which works in very old browsers (substituting100%
for100vh
if older browsers are required). - Similar to 2, you could instead apply
main { min-height: calc(100vh - footerHeight) }
to force the height of the main content area to be minimally tall enough to push the footer to the bottom. This has the same disadvantage as 2 but in some ways is more elegant because the solution requires one style rule.
Hope this helps! Maybe with this knowledge you can put forward a PR for the potion yourself! ;) Cheers
from magic-of-css.
Related Issues (19)
- HTML validation error in Chapter 2
- Elements on homepage constantly resize in Chrome HOT 4
- 'Button' potion - focus states HOT 1
- HTML5 validity error in potions/content-reordering HOT 1
- Experiment with fixed background attachment for active contextual code blocks
- —
- "Site temporarily disabled" HOT 2
- when next chapters? HOT 1
- ...brilliant HOT 1
- CSS Triggers HOT 1
- Content Reordering potion doesn’t work in Firefox HOT 4
- The New CSS Layout
- Background color HOT 1
- non webkit support? HOT 2
- Animation chapter HOT 1
- Better `float`/`inline-block` usage recomendations
- Typo on Chapter 4 (Colors): 'skeumorophism' used instead of 'skeuomorphism' [Minor]
- 3 Pane App HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magic-of-css.