Jumbotron featuring videos in a Bootstrap Carousel

I am attempting to create a bootstrap carousel featuring videos within a jumbotron. Despite my best efforts, I am struggling to make it work correctly. The videos appear too small within the jumbotron and seem to be overlaid by other elements. I have experimented with CSS adjustments to no avail in trying to enlarge the videos to occupy the entire space of the jumbotron as I intend for them to serve as the background.

My current HTML setup is as follows:

<body>
    <div class="jumbotron">
        <div class="carousel slide" id="myCarousel">
            <div class="carousel-inner">
            <div class="item active">
                <div class="container">
                    <div class="flex-video widescreen" style="margin: 0 auto;text-align:center;">2
                        <video id="video-background" preload muted autoplay loop>
                            <source src="images/cerb1.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
            </div>

            <div class="item">
                <div class="container">
                    <div class="flex-video widescreen" style="margin: 0 auto;text-align:center;">3
                        <video id="video-background" preload muted autoplay loop>
                            <source src="images/cerbkaff.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
            </div>

            <div class="item">
                <div class="container">
                    <div class="flex-video widescreen" style="margin: 0 auto;text-align:center;">4
                        <video id="video-background" preload muted autoplay loop>
                            <source src="images/cerbkaff2.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
             </div>
             </div> <!-- carousel-inner -->
            <a data-slide="prev" href="#myCarousel" class="left carousel-control">‹</a>
            <a data-slide="next" href="#myCarousel" class="right carousel-control">›</a>
        </div>

        <div class="container-fluid">
            <h2><b>BLA: BLALBLA BLA BLA TEST</h2>
        </div>
    </div> <!-- end jumbotron -->

In regards to my CSS settings:

.jumbotron {
    background-color: rgba(255, 255, 255, 0.075);
    position: relative;
    overflow: hidden;
    height: 400px;
}

.jumbotron .container-fluid {
  position: relative;
  color: #ffffff;
  z-index: 2;
}

#video-background { 
  position: absolute;
  height: auto;
  width: auto;
  min-height: 100%;
  min-width: 100%;
  left: 50%;
  top: 50%;
  -webkit-transform: translate3d(-50%, -50%, 0);
  transform: translate3d(-50%, -50%, 0);
  z-index: 9999;
}

However, the actual result is far from my desired outcome. The video carousel only displays as a small line, rather than occupying the full area of the jumbotron as shown in this image: https://i.sstatic.net/FzahE.png

If anyone has any insights on how I can resolve this issue, I would greatly appreciate your help!

Answer №1

The issue with the video background lies in its absolute positioning. Try removing this line of code:

position: absolute;

From the "video-background" class to see if that solves the problem.

Check out the plnkr example for reference: https://plnkr.co/edit/63xDn8EaGB3qDLSmtrx4?p=preview

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Customizing Material UI CSS in Angular: A Guide

Recently, while working with the Mat-grid-tile tag, I noticed that it utilizes a css class called .mat-grid-tile-content, which you can see below. The issue I am encountering is that the content within the mat-grid-tile tag appears centered, rather than f ...

What is the best way to ensure the footer is always positioned at the bottom of each page

Hey there, I'm having an issue with printing a large table on my HTML page. I want the footer to appear at the very bottom of every printed page, but so far I haven't found a perfect solution. I came across using tfoot, which prints the footer at ...

The art of styling <li> elements compared to <a> elements

While these inquiries may lean towards being subjective, I am interested in learning about the industry's generally accepted best practices: 1) With responsive design and collapsible menus becoming more common, should a nav or nav menu element be sty ...

Creating a JSON file using the attributes and values of HTML tags

I am seeking assistance in generating a JSON file from HTML data using jQuery. The HTML structure consists of multiple departments with similar tags and classes: <div class="department_one"> <h1>Name Of Manufacturer</h1> < ...

Trouble with Bootstrap Popover's visibility

My current setup involves a popover that is not initializing properly. The code I am using is shown below: HTML: <div data-toggle="popover" data-placement="bottom" data-content="xyz">...</div> JavaScript: $(function () { $('[data-t ...

Revamp the Design Layout of a Drag-and-Drop Tool

After experimenting with a drag and drop feature using jQuery, I discovered the following useful code snippet. Here's how it functions: $( "#sortable1, #sortable2" ).sortable({ connectWith: ".connectedSortable" }).disableSelection(); #so ...

What is the best way to display a background image within my div element?

I'm trying to create my first child inside the div.missions, but it's not displaying. The only thing showing is the background color of the second child. Can someone assist me with this issue? Let me share my code with you: Here's my HTML: ...

Anchor elements and other inline elements not triggering MouseLeave event

Take a look at this CodePen link, particularly in Chrome: https://codepen.io/pkroupoderov/pen/jdRowv Sometimes, the mouseLeave event doesn't trigger when a user quickly moves the mouse over multiple images. This results in some images still having t ...

How do I stop Bootstrap from taking over my custom navbar design?

My website's navbar stopped working after adding Bootstrap to my HTML pages. I suspect that Bootstrap is overriding my custom CSS. Here is the code for my navbar: .navbar { overflow: hidden; !important; background-color: #333; !important; } .. ...

Tips for avoiding anti-aliasing of bitmap font on Internet Explorer and Firefox

I am currently experiencing issues with font smoothing when using a basic bitmap font for icons. While the font appears crisp in Chrome, it appears blurry in IE and FF. Do you have any recommendations on how to resolve this problem? You can view a screen ...

Apply a specific image layout once the drop event occurs

I have a container with 5 image pieces that need to be dropped into another container to complete the image. Once an image is dropped, I want to apply the style "position:absolute" so that it sticks to the previous image in that container. Although I have ...

Leveraging the power of animate.css library to enhance page transitions on Nuxt

I've been working on implementing the animate.css library for nuxt page transitions, but I'm encountering some issues. I have successfully added animate.css to the nuxt.config.js file and it loads without any problems. However, when I try to use ...

When using XML, what situations can cause jquery's .attr() and getAttribute() to provide varying results?

When I receive an XML response from a server and parse it in jquery (jQuery 1.8.2 on Chrome 23.0.1271.64 and Firefox 15.01) to retrieve various attributes, it works correctly most of the time. However, occasionally the attr() call returns the entire elemen ...

Instructions on saving an aspx page content type on the server side as an HTML page and displaying this HTML on the client side

The Table I'm working with includes a header and footer, but unfortunately it lacks browser compatibility. My solution is to save the table in HTML format on the server side and display it on the client side without using print preview. It's ess ...

Dealing with errors in AJAX divs

Utilizing an AJAX-based script known as AJAXTwits, I've been able to seamlessly load multiple Twitter timelines for a sports team into a designated div. The standout features of this script include its ability to combine various timelines into a singl ...

Showing a numerical value in the bottom-right corner alongside a backdrop of an image

I am attempting to create a container that measures 26x26 pixels and showcases a number at the bottom right corner of this container. Furthermore, I want to include a 24x24 picture as the background of the container. The code I have written so far is disp ...

Is there a way to ensure that the fixed modal remains at the forefront and that its top stays in view even as the user scrolls?

Can you assist me in simplifying this code? import { LoginProps } from '@/layouts/layout.props'; import { Box, Button, Divider, Flex, FormControl, FormLabel, Heading, HStack, IconButton, Input, Link, Stack, Text, } from ...

Is there a way to incorporate a <u> tag into an inline angular variable in HTML that has been generated by a ternary expression?

Currently, I have the following scenario. <label> Make {{$ctrl.tcTemplate.isLibrary ? $ctrl.tcTemplate.name : "this item"}} a Library item: <toggle ng-change="changed(); $ctrl.eraseName();" ng-model="$ctrl.tcTemplate.isLibrary;" off="Fals ...

"Enhancing visual effects with personalized animations in Highcharts using setSeries or setCategories

I successfully created a customized highchart graph with 3 added buttons. An example can be viewed here: http://jsfiddle.net/eszwd420/ $(function () { var averageLabel =[1278302400000, 1286251200000, 1294203600000, 1301976000000, 13098384000 ...

What is the method for updating the content within a div element?

I am trying to add multiple elements to my content, including an h1 element, an input field, and some buttons. I have written a function to create the h1 and input elements, but when trying to add them to my content div, I encountered an error (TypeError ...