To maintain a fixed size of 600x600 pixels for a video embed on mobile view in Webflow, follow these steps to override responsive behavior and apply specific dimensions.
1. Add or Select the Embed Element
- Drag an Embed, Video, or HTML Embed element into your Webflow canvas.
- If you’re using an external video (like YouTube or Vimeo), you can use the Embed component and paste the video iframe source.
2. Wrap the Embed Inside a Div Block
- Wrap the video embed in a Div Block to control its size more easily.
- Name this div something like VideoWrapper for clarity.
3. Set Fixed Dimensions on Mobile View
- Go to the mobile breakpoint in Webflow using the responsive view switcher.
- Select the VideoWrapper div.
- In the Style panel, set:
- Width: 600px
- Height: 600px
- Make sure you set both properties to Fixed (px), not percentage or auto.
4. Prevent Scaling on Smaller Screens
- Webflow’s default behavior scales content responsively. To retain fixed dimensions:
- Still on the mobile view, select the VideoWrapper and in the Style panel:
- Set Overflow: Auto or Hidden to avoid clip or breakage.
- Optionally, set display: flex and justify/align center on the parent wrapper to center the video in a limited viewport.
5. Adjust the Embed Sizing
- Some embeds (like YouTube) use responsive iframes (width 100%, height auto). You should override this:
- Inside the embed HTML, set the iframe's
width="600"
and height="600"
explicitly. - Also, ensure any style attributes or classes don't override this with
100%
.
Summary
To keep a video at 600x600 pixels on mobile, wrap it in a div container, set fixed pixel dimensions in the mobile breakpoint, and adjust embed code to stop it from stretching. This ensures video dimensions remain consistent, regardless of screen size.