Making a background video fullscreen in Webflow can be confusing due to its responsive design mechanics, but here's a way to achieve it across all screen resolutions effectively.
1. Add a Background Video Component
- Drag a "Background Video" component onto your canvas from the Add panel.
- Select the video file you want to use. Ensure it is 1920x1080 as you mentioned.
2. Set Up the Container Element
- Wrap the Background Video in a Div Block. This will act as a responsive container.
- Ensure the Div Block has its width and height set to 100vw and 100vh respectively. This makes the video fill the screen.
3. Style the Background Video
- Select the Background Video component within the Div Block.
- Set its width and height to 100%. This ensures the video stretches with the container.
- Use object-fit: cover in the Custom CSS for the video component to maintain aspect ratio while covering the container completely.
4. Custom CSS for Fullscreen
- Go to Project Settings, under the Custom Code tab.
- Insert this CSS in the head section:
```
<style>
.fullscreen-background {
width: 100vw;
height: 100vh;
object-fit: cover;
}
</style>
```
- Set a class on your Background Video to
fullscreen-background to apply these styles.
5. Adjust Positioning as Needed
- Ensure the Div Block is set to position: absolute or position: fixed, top: 0, left: 0 to cover the entire viewport.
6. Publish and Test
- Publish your site to view the changes live.
- Check on various resolutions to ensure fullscreen is maintained.
Summary
You need to wrap the background video in a Div Block set to 100vw and 100vh, and apply object-fit: cover to the video to ensure it stretches across all screen sizes. This method ensures the video fills the screen, maintaining a fullscreen experience on all resolutions.