To keep a 1920x1080 video at the same aspect ratio across all breakpoints in Webflow, use consistent sizing and aspect ratio-preserving techniques.
1. Use a Responsive Wrapper with Padding Hack
- Create a Div Block that wraps your video element.
- Give the wrapper a position of relative.
- Set the wrapper’s width to 100% and padding-top to 56.25% (which is 1080 ÷ 1920).
- This creates a container that maintains a 16:9 aspect ratio regardless of screen size.
2. Set Video to Cover the Wrapper
- Place your video inside the wrapper.
- Set the video’s position to absolute, then top: 0, left: 0, width: 100%, height: 100%.
- This makes the video stretch to fill the wrapper while respecting the 16:9 ratio.
3. Disable Autoresize on Breakpoints
- Check all breakpoints in Webflow.
- For each one, avoid setting fixed width or height values that break the aspect ratio.
- Confirm that responsive styles (like % widths or max-width: 100%) are maintained consistently.
- If embedding a video (via custom code), make sure the
<video>
or <iframe>
follows the same structure. - Set the iframe attributes for responsive behavior (e.g.,
width="100%"
, height="100%"
, or use loading="lazy"
).
5. Avoid Fixed Width/Height in Pixels
- Do not set the video to 1920px by 1080px directly, as this will break layout on smaller screens.
- Instead, rely on CSS scaling with responsive units and the aspect ratio method above.
Summary
To keep a 1920x1080 video responsive and maintain its aspect ratio across breakpoints, wrap it in a relatively positioned div with 56.25% padding-top, then absolutely position the video inside it with 100% width and height. Avoid using fixed pixel dimensions on the video element to ensure full responsiveness.