Learn Bubble with 500+ tutorials, courses & AI Assistant ✨

Limited time launch offer get $80 off today

0 days 0 hours 0 minutes 0 seconds
SAVE $80 NOW
Planet No Code logo
Bubble.io CoachingFounder MentoringSponsorships
LoginLearn Bubble.io

How to Create a Background Video In Bubble

In this Bubble.io tutorial video we demonstrate how to create a background video hero section using HTML that works on mobile.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
How to Create a Background Video In Bubble
Explore these topics...
Design
HTML

With just this tutorial learn...

Master full-width background videos: Learn the secret HTML snippet for responsive, eye-catching Bubble layouts.

Unlock pro-level Bubble design: Discover how to layer content over videos and create stunning hero sections without coding.

Transform your Bubble app's visual appeal: Step-by-step guide to implementing autoplay background videos that work across devices.

With membership you'll...

Learn how to build a ChatGPT Clone, Custom CRM for your business & SaaS Marketing website with Webflow & AI.

Unlock 500+ Bubble tutorial videos with AI powered Q&A.

Debug your Bubble app instantly with our custom trained No Code AI Assistant.

Join now $19/month
Risk-free! 14-day money-back guarantee. Cancel anytime.

Creating a Background Video in Bubble

In this video, I demonstrate how to create a background video in Bubble. This is in response to a comment we've received on YouTube, so thanks to everyone who's leaving comments and video requests. We read all of them and try to turn around a video response to a topic as quickly as we can.

Demonstrating the Background Video

Let me demonstrate what this looks like on the front end and show you the different components to it. The requirements that I've laid out are that my video needs to be full width and also needs to be 100% of the viewport height. I'm going to walk you through the code snippet that I've created and placed inside an HTML element and explain each part to you as we go along so hopefully you can copy it and build this up in your own app.

Setting Up the Page Layout

Let's start at the top of the page. My page is using the new responsive engine and my layout is aligned to parent. That's important because it's going to allow me to place content on top of the video, which I'll demonstrate at the end of the video. Inside and positioned in the middle, I have an HTML element.

Configuring the HTML Element

For some reason, when you create an HTML element, at least I find this, Bubble applies some default padding which will mean you can't get your edge-to-edge look. So make sure you set your padding to zero on the vertical and the horizontal.

Explaining the HTML Snippet

Let's dig into this HTML snippet and I'll explain each part to you. We have a video tag which opens here and closes there, and then within that, we have a source tag which opens and closes there.

Video Attributes

Working from the top, we've got "autoplay" which means that when the page loads, the video starts playing. We have "muted" so if the video has any sound, it's by default set to mute. The browser picks that up. The video "loops" (self-explanatory) and then "plays inline". In my experience, two of the key points here to getting your video to work well on mobile are the "muted" and the "plays inline" attributes.

iOS Considerations

I know from experience with iOS that "plays inline" - you have to include this attribute here, otherwise the video won't auto-play on iOS. It's also worth mentioning when you test this that I believe, again on iOS, if you have the battery saver mode activated, then actually Safari doesn't auto-play background videos.

Custom CSS for the Video

We then have some custom CSS, and I'll explain each part to you. The height is set to 100% of the viewport height. That's how I ensure my video goes all the way down. Just so you're aware, because I have the debug mode enabled, that explains the white gap at the bottom, and it's also making space for this bar.

Width and Z-Index

We've got the width 100% because I'm using the Bubble new responsive engine, my page's width is always going to be 100% of the browser window. Z-index - if you imagine that your website or your web app is made of layers, different elements layered on top of each other, your Z-index describes where in the hierarchy an element comes. Because this is a background, I want to ensure that nothing goes behind it and everything goes in front of it, so I've given it a Z-index of -1.

Making the Video Responsive

Lastly, so that my video is responsive, I have added "object-fit: cover". This is to ensure that as my browser window changes to be fully responsive, if it was to stretch wider or higher, the video still fills all the space that I want it to. Because the video has an aspect ratio, I don't want the video to be squished or squeezed or stretched. In fact, when the viewport width changes, I want the video to be cropped rather than creating a white space or stretching or squeezing the video.

Video Source and Type

We then have the source. Your video has to be in mp4 format. I've just linked through to a stock video website called Cover for this demonstration. Here is the source of that video file, and I placed it there. You could upload this to your own web hosting or to Bubble. This isn't going to work for a YouTube video. The last bit here is type - I'm declaring to the web browser the type of content and that it's video and it's mp4.

Building a Hero Section

The real strength of doing it like this is that I can begin to build up a hero section here on my website. So I can have some welcome text, and I'll just center that and make it white. If I refresh, Bubble knows that the Z-index is going to be higher than -1, so that's why the text appears in front.

Creating a Group Section

If I wanted to build out more of a group section here, I've got align to parent which means that any other elements that I add here are going to appear on top of each other. The way to get around that would be to create a group like a column group here and then adjust the height. That then allows me to center that.

Final Touches

I could even go as far as clipping the background. I could go as far as setting it given that I wanted it to be dark anytime and then add some padding. Refresh that, and there you go.

Conclusion

Hopefully, I've demonstrated the code snippet required to add a background video using HTML. I've explained why each part of it is required. If you've got any questions, please leave it in the comments and we'll get back to you as quickly as possible.

Table of contents

Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Your No-Code Journey Starts Here

The best way to learn Bubble.io?

Build No Code Confidently

No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.

Find every solution in one place

No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.

Dive deep into every detail

Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Monthly
Yearly
Member
Accelerate your Bubble app to launch
$99 / month
$19/month/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now
Member
Accelerate your Bubble app to launch
$990 / year
$149/year/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now

Frequently Asked Questions

Find answers to common questions about our courses, tutorials & content.

Do I need any coding experience?

No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.

How does the AI No-Code Coach work?

Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.

How long can I access the content?

As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.

What courses are included

Your subscription includes:

  • Bubble Beginner Essentials – Get up and running fast.
  • Build a ChatGPT Clone – Integrate AI into your no-code apps.
  • Build Your SaaS Website with AI – Learn to create a scalable startup site.
  • Develop a Custom CRM App in Bubble - Learn database relationships with a CRM.

Plus, new tutorials every week!

What if I get stuck on a lesson?

The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.

Do you offer a money-back guarantee?

Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.

Can I cancel anytime?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

What if I want more than just tutorials & courses?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:

  1. 1:1 mentorship to fast-track your progress
  2. Marketing strategies tailored for no-code founders‍
  3. Product management insights to scale your startup‍
  4. Personalized support from experienced founders

‍

Still have questions?

Reach out to our dedicated team.

Contact
Services
Search Bubble TutorialsBubble.io CoursesBook Bubble.io CoachingApply for Mastery
Latest Bubble tutorials
Rerank Text By MEANING With Cohere In Bubble.io Step by Step!
Unlock RAG Providers for NO CODE AI App Development TODAY!
Better Tables with Built-in Search and Sort By in Bubble.io
Partnerships
Flusk.eu
VectorShift
Comnoco
Plumb
Toddle
Whereby
Get started with no code
AI Powered No Code AppsNo Code Web ScrapingBubble.io Plugin tutorialsBubble API Connector tutorialsStudent & Teacher DiscountBest tools for no coders
Follow us
Youtube
X
LinkedIn
Planet No Code logo
In partnership with
Queen Mary University of London Logo
© 2024 Planet No Code. All rights reserved.
Privacy PolicyTerms of ServiceCookies SettingsContact Us