Styling elements

How to add a video background

How to add a video background

TeleportHQ has no video option in the Background section. To put a video behind your content, add a Video element inside the section, make sure it plays automatically, muted and on repeat, stretch it to fill the section, and raise the section's other content above it. The result works like a background video on your published site.

Before you start

Steps

1. Add the video to the section

  1. In the left sidebar, open the Assets Manager and find your video.
  2. Drag the video onto the canvas, into the section you want, for example your hero section. Drop it as the first element inside the section.

A Video element is added and selected.

2. Make it play like a background

  1. With the video selected, find the Video section in the right panel. If it shows only its title, click the + next to the title.
  2. Check that autoPlay, muted, loop and playsInline are set to True. A new Video element starts like this. To change one, click True or False in its switch.
  3. Check that controls is set to False, so no play buttons show over your content.
The Video section of the TeleportHQ right panel, with loop, muted, autoPlay and playsInline set to True highlighted, and controls set to False highlighted

Browsers only play videos automatically when they're muted. playsInline stops phones from opening the video full screen.

3. Stretch the video to fill the section

  1. With the video selected, open Position and choose Freestyle.
  2. In the offset boxes, set Top to 0 and Left to 0.
  3. Open Size. Set Width to 100% and Height to 100%.
  4. In Object Fit, choose cover. The video fills the section without stretching.

4. Keep the content on top

  1. Select the section's content, for example the container with your heading and button.
  2. In Position, choose Relative.
  3. In Z-index, type 1.

5. Keep the video inside the section

  1. Select the section itself.
  2. In Size, set Overflow to hidden.

Check that it worked

On the canvas, the video fills the section behind your heading and button. To see it play, click Preview in the bottom toolbar. The video starts on its own, without sound, and repeats.

Troubleshooting

"Cannot upload video files" Your workspace isn't on a trial or paid plan. Upgrade the workspace, or use a Pexels stock video instead. For plans, see https://teleporthq.io/pricing.

"Upload failed. The maximum file size is 10MB" The video is bigger than your plan allows. Compress it or shorten it, then upload it again. The message always says 10MB, but some plans allow bigger files. See Which files can I upload, and how big can they be?.

"Videos are not compressed when published: visitors download the whole file." The video is 5 MB or more, for example "hero.mp4" is 12 MB. The upload still works, but a big background video slows your page. Shorten it or export it at a smaller size, then upload it again.

The video covers my text The content isn't raised above the video. Give the content container Relative position and a Z-index of 1 or higher.

The video spills into other sections Set Overflow to hidden on the section that holds the video. Also check that the section's Position is Relative. Choosing Freestyle for the video sets this automatically ("Position Relative was set to the parent container."), but only when the section had no position before.

The video doesn't play on the canvas or on a phone Check in Preview or on the published site. Make sure autoPlay, muted and playsInline are all set to True.

Good to know

  • A still image, called a poster, can show while the video loads. With the video selected, right-click an image in the Assets Manager and choose Replace Video Poster.
  • Stock videos from Pexels stay linked to Pexels on your published site.
  • To show a different height on mobile, switch to the mobile screen size and change the section's height there. See How to change styles for mobile only.
  • For a video that plays frame by frame as visitors scroll, instead of on a loop, use Scroll Video. See How to add a video that plays as visitors scroll (Scroll Video).
Share

Related Articles

How to change an element's background color, gradient or image

In TeleportHQ, select the element, open Background in the right panel, click + and choose color, gradient or image; image backgrounds have Size, Repeat and Position settings, and several gradients and images can be stacked as layers.

How to add a video from your computer

In TeleportHQ, you upload an MP4, M4V or MOV file to the Assets Manager, drag it onto your page as a Video element, and set its poster, controls, autoplay, loop and sound in the Video section of the right panel.

How to use free stock photos and videos (Unsplash, Pexels)

In the TeleportHQ Assets Manager, open the Stock tab, choose Unsplash or Pexels, search for a subject such as "bread", and drag a photo or video onto your page; stock media is free and doesn't use your project's storage.

How to position elements (Auto, Relative, Freestyle, Fixed, Sticky)

In the TeleportHQ editor, you position an element from the Position section of the right panel by choosing Auto, Relative, Freestyle, Fixed or Sticky, then setting its offsets and Z-index; Freestyle elements can also be dragged on the canvas, where they snap to their neighbours.

Which files can I upload, and how big can they be?

TeleportHQ accepts images (jpg, png, gif, svg, webp, ico), videos (mp4, m4v, mov), documents (pdf, Word, Excel, PowerPoint, zip), audio, .glb 3D models, fonts and text files; trial and Pro plans allow 10 MB per file and 1 GB per project, Premium allows 30 MB per file and 3 GB per project, and smaller files are flagged as heavy when they would slow a page down.

How to add a video that plays as visitors scroll (Scroll Video)

In TeleportHQ, add a Scroll Video from the Motion group of the Elements panel, then choose or upload a clip (or make one with AI); TeleportHQ optimizes the clip for scrolling, plays it forward as visitors scroll down and backward as they scroll up, and shows a still picture to visitors who ask for reduced motion.