Flexbox Sticky Footer

Size
3,404 Kb
Views
52,624

How do I make an flexbox sticky footer?

Http://philipwalton.github.io/solved-by-flexbox/. What is a flexbox sticky footer? How do you make a flexbox sticky footer? This script and codes were developed by Boost New Media on 12 June 2022, Sunday.

Flexbox Sticky Footer Previews

Flexbox Sticky Footer - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flexbox Sticky Footer</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ /* Global Styles */
* { margin: 0; box-sizing: border-box;
}
html, body { font-size: 1.35rem; line-height: 1.5; font-family: serif;
}
/*============================================= */
/*============================================= */
/*This makes the page 100% of the viewport - Body doesn't need it, as this breaks the Sticky footer. */
html { height: 100%;
}
/*The min-height value calulates the the true height of all the elements combined. When this happens, the viewport will simply collapse above the items. */
body.wrap { display: flex; min-height: 100%; flex-direction: column;
}
main { /* This simply stretches the element to fill the empty space. */ flex: 1;
}
.site { background: #ccc;
}
header, footer { background: #333; color: white; line-height: 142px; height: 142px; text-align: center; background: #B72039;
}
main { padding: 20px; text-align: center;
}
footer { background: #333;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <body class='wrap'> <header> Header </header> <main> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit. </main> <footer> hi </footer>
</body>
</body>
</html>

Flexbox Sticky Footer - Script Codes CSS Codes

/* Global Styles */
* { margin: 0; box-sizing: border-box;
}
html, body { font-size: 1.35rem; line-height: 1.5; font-family: serif;
}
/*============================================= */
/*============================================= */
/*This makes the page 100% of the viewport - Body doesn't need it, as this breaks the Sticky footer. */
html { height: 100%;
}
/*The min-height value calulates the the true height of all the elements combined. When this happens, the viewport will simply collapse above the items. */
body.wrap { display: flex; min-height: 100%; flex-direction: column;
}
main { /* This simply stretches the element to fill the empty space. */ flex: 1;
}
.site { background: #ccc;
}
header, footer { background: #333; color: white; line-height: 142px; height: 142px; text-align: center; background: #B72039;
}
main { padding: 20px; text-align: center;
}
footer { background: #333;
}
Flexbox Sticky Footer - Script Codes
Flexbox Sticky Footer - Script Codes
Home Page Home
Developer Boost New Media
Username boostnewmedia
Uploaded June 12, 2022
Rating 3
Size 3,404 Kb
Views 52,624
Do you need developer help for Flexbox Sticky Footer?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Boost New Media (boostnewmedia) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!