Skip to main content

Responsive settings to lock the aspect ratio of an Embed box

Learn how to set up an Embed box so it keeps a fixed aspect ratio as it resizes. This article walks you through an example: keeping an embedded YouTube video at a 16:9 ratio using responsive settings in Studio.Design.

Elements embedded using an Embed box can keep a fixed aspect ratio on any screen size by following the responsive settings below.

How to lock the aspect ratio of an Embed box

Example: Responsive settings that keep a YouTube video embedded in an Embed box at a 16:9 aspect ratio on any screen size.

(1) Create a parent box.

  1. Click the Add icon in the navigation.

  2. Click the [Basic] tab.

  3. Click [Box].

  4. A box is placed on the screen.

The width of this box will become the maximum width of the Embed box you'll layer on top later.

(2) Prepare an image with the desired aspect ratio.

Note: This image is only used to lock the aspect ratio and won't actually appear on your published site.

  1. Prepare an image that already has the aspect ratio you want.

  2. Place the image inside the parent box from step (1).

  3. Set the image type to [img].

(3) Match the image and parent box sizes.

  1. Select the image and open the right panel. If the right panel is closed, open it.

  2. Open the [Box] tab and set the width to [100%] so the image matches the parent box's width.

  3. Select the parent box and open the right panel. If the right panel is closed, open it.

  4. Open the [Box] tab and set the parent box's height to [auto] so it matches the image's height.

The parent box now follows the aspect ratio of the image you prepared.

(3) Add the Embed box.

  1. Click the Add icon in the navigation.

  2. Click the [Basic] tab.

  3. Click [Blank] in the [Embed] section.

  4. Move the Embed box that was placed on the screen into the parent box from step (1).
    You can do this easily by dragging it in the Layer panel.

  5. Select the Embed box and open the right panel. If the right panel is closed, open it.

  6. Open the [Box] tab and set both width and height to 100%.

  7. In the [Box] tab, set the position to [Absolute].
    Set the top, bottom, left, and right [distances] to 0 or -.

Did this answer your question?