How can I make an embedded video scale with the device size in Webflow?

TL;DR
  • Create a Div Block set to 100% width for the video.
  • Insert and modify the video embed code to use a 100% width and CSS padding-top for aspect ratio.
  • Apply CSS styling for responsive scaling across devices.

To make an embedded video scale with the device size in Webflow, the video should be responsive. Here's how you can do that:

1. Create a Div Block

  • Add a Div Block to your Webflow project where you want the video to appear.
  • Ensure that this Div Block is set to a 100% width to allow it to scale fully across the container.

2. Embed the Video

  • Insert an Embed Element inside the Div Block.
  • Paste Your Video Embed Code into the Embed Element. Make sure the embed code includes the necessary responsive attributes.

3. Alter the Embed Code for Responsiveness

  • Find the width and height attributes in the embed code and remove these fixed pixel values.
  • Set the Width to 100% to let the video fill the containing element.
  • Use CSS Padding-Top to maintain aspect ratio. For example, if you want a 16:9 aspect ratio, set padding-top to 56.25%.

4. Apply CSS Styling

  • Add CSS Styling to your project for responsive video. Use the class you applied to the Div Block and define properties as needed, such as the padding-top for aspect ratio maintenance.

Final Summary

To make an embedded video responsive in Webflow, embed the video in a Div Block set to 100% width, adjust the embed code to use percentage-based dimensions, and apply CSS for aspect ratio. This ensures the video scales effectively across all device sizes.

Rate this answer

Other Webflow Questions