Re:Sticky Footer
by amelius on Monday September 30, 2019 @05:36AM
(#21113245)
CSS is just broken. I want to use general expressions like
[ Parent
| on HN ]
You can!
:root {
--header-height: 5em;
--container-height: 25em;
--other-height: 2.5em;
}
div {
height: calc(var(--container-height) - var(--header-height) + (var(--other-height)*2));
}But this example uses static sizes, unlike the sticky footer problem of the article (where e.g. the window can be resized by the user).
Can CSS calc() be used with dynamic widths or heights of other elements?