
Best Practices for HTML Background Video Optimization
Background videos are a website staple and can make a positive impact on users, but are often not fully optimized. This post covers the main aspects of optimizing background videos.

Back in 2016, we wrote a post called Creating a Sticky Footer with Flexbox. Not much has changed since then. If you want to push your footer to the bottom of the browser (regardless of your content size) then this is still one of the better methods. We’re using this technique today.
But if you’re using Tailwind CSS as your front-end framework, this is easier than ever! Before, we had to write custom CSS for multiple elements and/or classes. Now, we can achieve an identical effect with just a few Tailwind utility classes:
<body class="flex flex-col min-h-screen">
<header>...</header>
<main class="flex-auto">...</main>
<footer>...</footer>
</body>The first two body classes (.flex and .flex-col) turn the body element into a vertical flex container.
.min-h-screen matches the element's height to the user's browser height.
Finally, flex-auto expands the main element to fill the available space, pushing the footer to the bottom of the screen.
Using these utility classes is the same as adding the following CSS to your body and main elements:
body {
display: flex; // .flex
flex-direction: column; // .flex-col
min-height: 100vh; // .min-h-screen
}
main {
flex: 1 1 auto; // .flex-auto
}And that's it! If you start your next Tailwind project with this markup, then you’ll never need to worry about your footer riding up on short pages.
You can view a working example of this at Codepen.
Background videos are a website staple and can make a positive impact on users, but are often not fully optimized. This post covers the main aspects of optimizing background videos.
Here's how we converted our own site from Foundation to Tailwind, along with a cheat sheet to help you do the same.
Overall website performance has always been important but after Google's Page Experience updates in 2021, it's more important than ever. Improving your site's Core Web Vitals can drastically improve the page experience for your site visitors.
We respond within one business day and will tell you honestly whether we're the right fit.
Schedule a Call
