What's "padding-top: Magic"?

I noticed a “padding-top: Magic” default setting for embed component. See screenshot. What is it?

Hey there.
This indicates webflow automatically handles the padding based on the embed you are using.

It’s for embeds like videos. It helps keep the video in the right 16:9 ratio

@Maciej That refers to the “intrinsic ratio” that makes the video element responsive like an image (otherwise videos are not responsive by default). There’s more background on this technique here: Creating Intrinsic Ratios for Video – A List Apart

This is usually handled by developers with JavaScript using libraries like http://fitvidsjs.com/, but Webflow pre-computes these values when you first embed the video saving you time and headaches - hence the magic :smile:

7 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.