> For the complete documentation index, see [llms.txt](https://docs.webstudio.is/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webstudio.is/university/how-tos/how-to-create-fluid-video-backgrounds-with-vimeo.md).

# How to create fluid video backgrounds with Vimeo

{% embed url="<https://youtu.be/XO3AntguPZE?si=gGQ_93CXQWLnoLwP>" %}

Create stunning full-width video backgrounds that scale beautifully across all screen sizes using Vimeo.

## Overview

Video backgrounds can add visual impact to your website. Using the **Vimeo** component in Webstudio, you can create fluid, responsive video backgrounds that cover their container perfectly.

## Component Structure

```
Hero (Box)
├── Content (Box) - z-index: 2
│   └── Your headings, text, buttons
└── Background Video (Box)
    ├── Overlay (Box) - position: absolute, inset: 0, z-index: 1
    └── Vimeo - position: absolute, inset: 0
```

## Step-by-Step Guide

### 1. Set Up the Hero Box

1. Add a **Box** component to your page (name it "Hero")
2. Set **Display**: Flex (centered)
3. Set **Position**: Relative
4. Set **Overflow**: Hidden

### 2. Add the Background Video Box

1. Inside the Hero, add another **Box** (name it "Background Video")
2. Set **Min-width**: 100%
3. Set **Min-height**: 100%
4. Set **Aspect ratio**: 16:9 (important — Vimeo forces this ratio)
5. Set **Overflow**: Hidden
6. Set **Position**: Absolute

### 3. Add the Overlay

1. Inside Background Video Box, add a **Box** (name it "Overlay")
2. Set **Position**: Absolute
3. Set all sides (top, right, bottom, left) to 0 (hold Shift while dragging)
4. Set **Z-index**: 1
5. Add a semi-transparent background color for text readability

### 4. Add the Vimeo Component

1. Add a **Vimeo** component inside the Background Video Box
2. Enter your Vimeo video URL
3. Remove the default width and aspect ratio
4. Set **Position**: Absolute with all sides at 0
5. Configure settings:
   * **Enable**: Show Preview, Autoplay, Background Mode, Loop, Muted, Do Not Track
   * **Disable**: Portrait (avatar), Controls
6. Hide the **Spinner** and **Play Button** instances (they're not needed for background video)

### 5. Add the Content Box

1. Add another **Box** inside Hero (name it "Content")
2. Set **Z-index**: 2 (so content appears above the overlay and video)
3. Add padding to control the section height
4. Add your content (headings, text, buttons)

{% hint style="info" %}
The video background automatically scales because the container grows with the content's padding. Add padding to the Content box to control the overall section height.
{% endhint %}

## Tips

* **Performance**: Compress videos and keep them short for faster loading
* **Mobile**: Consider hiding video backgrounds on mobile and using a static image instead
* **Accessibility**: Don't rely on video content to convey critical information
* **Fallback**: Add a poster image or background color for loading states

## Related

* [Vimeo Background Video](/university/core-components/vimeo-background-video.md) – Simplified component for video backgrounds
* [Vimeo](/university/core-components/vimeo.md) – Embed Vimeo videos with full controls
* [Image](/university/core-components/image.md) – Use images as fallback backgrounds
* [Animations](/university/foundations/animations.md) – Add motion to your video sections


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.webstudio.is/university/how-tos/how-to-create-fluid-video-backgrounds-with-vimeo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
