Hi!
I am working on a wordpress website and want to implement a footer that is pushed to the lower edge of the browser screen if the content get´s smaller than the browser screen hight.
I want to use this approach:
Now I am looking for an effective way with CSS and HTML to implement that for 2 different page types and one media query breakpoint. I am using Code Snippets Plugin to place my code:
add_action( 'wp_head', function () { ?>
<style>
:root {
--FooterHight: 157px;
--secondary-bg-color: gold;
}
@media only screen and (min-width: 768px) {
body(.home) {
--HeaderHight: 288px;
.page-content {
min-height: calc(100vh - (HeaderHight + FooterHight)); /* 445px */
}
}
body:not(.home)
--HeaderHight: 63px;
.page-content {
min-height: calc(100vh - (HeaderHight + FooterHight)); /* 220px */
}
}
@media only screen and (max-width: 768px) {
body(.home) {
--HeaderHight: 248px;
.page-content {
min-height: calc(100vh - (HeaderHight + FooterHight)); /* 405px */
}
}
body:not(.home)
--HeaderHight = 63px;
.page-content {
min-height: calc(100vh - (HeaderHight + FooterHight)); /* 220px */
}
}
</style>
<?php } );
Now with this nothing happens… I kind of think there is still some syntax issues I can not find… or some addressing not working properly… any idea what´s wrong here…
Pagelink is:
https://spehzies.haywood.de/kontakt/