Create a full-height and full-width video using Bootstrap 4 that expands to fill the remaining space in the

How can I make the video fill out the remaining space below, as shown in the picture below.

<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.6.0/d3.min.js"></script>
<div class="container-fluid h-100 red">
<div class="row justify-content-left h-100">
<div class="col-md-4 text-center" id="yellow">
<h3 class="display-3">Sublime</h3>
<h4 class="display-4">What we do.</h4>
<p class="p-3 my-3">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Asperiores voluptates at provident fugiat ipsam voluptas illum quidem dolores pariatur, culpa, ab optio eum perferendis! Et magni doloremque voluptatem temporibus maiores?</p>
</div>
<div class="col-md-8 blue px-0">
<!--mask color-->
<div class="view">
<!--video Source-->
<video class="video-fluid" autoplay loop muted>
<source src="/videos/171003A_009_2K.mp4" type="video/mp4"></source>
</video>
<div class="mask rgba-indigo-light"></div>
</div>
</div>
</div>
</div>
[`

.video-fluid {
    width: 100%;
    height: auto;
}
https://i.sstatic.net/qiQh4.png

Answer №1

Your <video> tag is using the following CSS class:

.video-fluid {
    width: 100%;
    height: auto;
}

The width: 100% property instructs the browser to make the video occupy 100% of the allocated width, extending from the end of any adjacent panel to the edge of the browser window. The height: auto setting adjusts the height to maintain the aspect ratio of the <video> element. For example, if the video's aspect ratio is 16:9 and it is given a width of 1600px, the height will be set to 900px.

You can experiment with setting the height to 100%, but due to differences in aspect ratios, the result may not be as expected. Alternatively, you can render the video at a larger size and center it within the available white space to fill the screen without distorting the video content.

Answer №2

Like mentioned by others, setting the height to 100% may cause the image to stretch or lose content. To achieve the best ratio, you can improve your CSS with an additional line of code:

.video-fluid {
    max-width: 100%;
    width:auto;
    height: auto;
}

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

Unable to determine the appropriate signature for calling the date function

<td> {{ fundInfo.startDate | date: "yyyy-MM-dd" }} </td> The issue is located in the primeng-test-b.component.html file under src\app\primeng-test-b directory. ...

Achieving right-aligned buttons in Bootstrap

Is there a way to align a button to the left inside a div that has the class justify-content-center applied? Here is the code I tried: <div class="card-header justify-content-center"> <div> <div class="ml-5"> Text i ...

Embed Socket.IO into the head tag of the HTML document

After working with socket.IO and starting off with a chat example, my chat service has become quite complex. The foundation of my code is from the original tutorial where they included <script src="/socket.io/socket.io.js"></script> <scrip ...

What is the best way to subtract 100px from 100% using a combination of CSS

I have implemented the same code in both CSS and jQuery: width: 100% -100px; Here is how I tried to execute it: $(document).ready(function(){ $('.left').css('width', '100%').css('width', '-=100px'); ...

Updating background image according to the time in a specific location

I've been struggling with this issue for more than 4 hours now. None of the solutions provided on Stack Overflow seem to work for me. Here's the code snippet I've been working on: <html> <head> <style> .day { ...

Adjust padding of radio button labels in Qualtrics for a cleaner, more streamlined appearance

As I delve into the world of CSS, my goal is to customize the existing survey theme known as "Minimal 2014". Specifically, my focus is on minimizing the spacing in various areas to create a more compact design. So far, I've successfully reduced the g ...

Struggling to set up SCSS integration with Bootstrap in a React project?

Currently, as I delve into learning React, I am encountering an issue with configuring SCSS alongside Bootstrap in a project that was originally constructed by a friend. The Bootstrap setup works flawlessly, but I encounter a particular type error when att ...

Enhancing image search functionality through dynamic HTML updates

I need help figuring out how to update the link address for profile pictures on my NHL stats website. Currently, I am using a script to append the image to the body, but I don't know how to properly add the player ID ({{p1_ID}}) to the link and includ ...

How can a hidden div be shown within a parent div that is set to display: none without altering the parent div?

I'm dealing with a wrapper div that has the classes d-none d-lg-block, making it visible only on large screens. Inside this wrapper, there's another div that should become visible when the user clicks a button. I've tried various methods to ...

Tips for maintaining a scrollable Material-UI Table with dynamic height?

I'm encountering an issue with the Material-UI Table component in terms of its size and scrollability. Summary: The Material-UI table only becomes scrollable when its parent has a fixed size. If I set the size to 100% to fit the parent, it overflows. ...

What is the best way to display a multiline string returned by a function on different lines within a Vue template?

Need some help with a coding issue. My function gives me output ${a}-${b} and in my template <td>{{ myFunction() }}</td> Currently, it displays A-B in the cell. I want it to show A on one line and B on a new line. I've attempted ${a}&bso ...

Guide on how to dynamically generate a dropdown menu based on the selection made in another dropdown

Could anyone provide me with a demonstration on how to dynamically create a dropdown menu based on the onchange event of another dropdown? I currently have a dropdown menu where users can select multiple options, as shown below: <select id='fir ...

Looking for way to trigger a MP3 player to play songs simply by clicking on them using an <a> tag?

I created a selection of songs in my <a> tags and I am looking to implement a universal mp3 player that will play the selected song without needing to refresh the page or open it in a new tab. I want the song to play directly on the player when click ...

Discovering the nearest form to a button containing a specific text value

On my web page, I have several forms. My goal is to identify the form that contains an "Add" button, assign it an ID, and then locate an input element within that form to set a value. For example, consider this sample HTML: <H1>Add A Call Route&l ...

Troubleshooting a background image problem in a TailwindCSS configuration file

I'm having trouble getting the background image to show up correctly using tailwind.Config.Js. Even though Tailwind.Config.Js is generating the background image perfectly, when I view it in the browser, it's displaying a 404 error for the image. ...

Style line breaks using CSS

Can CSS(3) be used to visually or textually emphasize line breaks that were automatically added by browsers? For example, displaying a symbol like ↻ at the end of each wrapped line. It is crucial to identify where lines were wrapped in source code, as n ...

"When a jQuery button is clicked, retrieve the div element with a specific class

I'm currently in the midst of crafting a jQuery client script and my goal is to ensure it's adaptable to any situation. One specific challenge I am facing is how to target a div with the class ".targets" when a button is clicked. The structure ...

Discovering the positions of HTML elements rendered with WebKit (or Gecko) technology

I am seeking a way to retrieve the dimensions (coordinates) of all HTML elements on a webpage as they appear in a browser, including their rendered positions. Specifically, I need to obtain values like (top-left, top-right, bottom-left, bottom-right) Afte ...

The combination of Superscrollorama and responsive design results in a lack of smooth flow

Looking to implement Superscrollorama animations for arrows on a specific website: The site is designed to be responsive across various sizes - 960+, 768, 480, and 320. Media queries are utilized to trigger the different layouts. While the arrows animate ...

Adding a see-through Bootstrap Navbar to a Fullpage.js website: A step-by-step guide

I am trying to incorporate a transparent Bootstrap Navbar into my page that is using fullpage.js. The desired outcome is for the navbar to stay on top of the page without affecting the layout of the website content. I have referenced an example here, but ...