Background video size

Hi all,

I am trying to use a background video for a thumbnail.

I have uploaded it the same size as the image next to it.
But it seems to display some sort of random size? :confused:

I really want it to display the correct size.
I’ve seen a few posts on here using custom code to fix this issue.
Is there a way to do this in webflow?

Any ideas?

Share link:

Here is my site Read-Only: LINK
(how to share your site Read-Only link)

First, this is not a specific issue ofbackground-video (See “empty div example” below)

Why? You combine real images with bg-images/videos/color==== The div is empty!! & the height of the element set bypadding/min/max-height/height) – for example:

And this is whats happen when i remove the height property (The video “disappear”):


Try this trick (No custom code - but this is not dynamic (If in the future you change the sizes of the “real” images you should also change thepadding-top %)


Why padding-top: 76.3%;?

Images size: 908 (width) / 1190 (height) X 100 = 76.3%

Empty div example:

Same idea with regular div with red background (To demonstrate this is not video issue)

Read more here:


this looks excellent :slight_smile: going to try it now

thanks once again

Why padding-top: 76.3%; ?

Images size: 908 (width) X 1190 (height) X 100 = 76.3%

^ is that right? I can’t seem to get 76.3% :thinking:

sorry. Divide.
(908 / 1190) = 0.76302

1 Like

ahh yes! thanks, that was driving me nuts :slight_smile:

1 Like

any idea why the video seems to be chopping off the top?

in this case, his head

No background-size: cover; for videos. The background-idea is more for a sky, clouds and so on (Not for content like faces -or- text). Maybe also this % trick wont work well with webflow styles.

Solution (maybe)

Webflow adds the video element (by js) - and add styles - so you must use custom code:

With inspect element this solve this issue (copy-paste before head)

   .w-background-video > video {
       width: 100%;





Thank you again loads. I’ll try this trick and let you know if it works :slight_smile:

So the custom code works :slight_smile:
But only when I publish it. It doesn’t work when I look in preview?

Is this normal?

Great ! :slight_smile: Yes. Custom CSS “works” only on live url (Like JS).

1 Like

Ahhh I didn’t know this. Thanks again!

Hey again! I’m having trouble putting a background video on one of my pages.

Starting to think it might be that custom code interfering?

Basically it doesn’t seem to display.


If you could help again would be much appreciated!

Its on the SoftBank case study.

Share link -

@ryan585 i dont see any video under this page. Write me in private - this Q not related to all users. Thanks

1 Like