Learn the process of covering the entire screen with a video

I'm attempting to achieve this: IMG

Below is the code snippet I've been using:

  <div class="container" id="containervideo">
  <div id="video">
        <div class="box iframe-box">
         <div class="container">
          <iframe src="http://player.vimeo.com/video/67794477?title=0&amp;byline=0&amp;portrait=0&amp;color=0fb0d4" width="1280" height="720" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
            </div>
        </div>
      </div>

  </div>

CSS:

#containervideo {
    width: 100%;
    height: 100%;
    position: absolute;
    padding: 0;
    margin: 0;
    left: 2px;
    top: 936px;
    z-index: -1000;
    overflow: hidden;
    }
    #video { 

min-height: 100%;
    //min-width:100%; - if fit to width
position:absolute;
bottom:0px;
left:0;
    }

The issue I am facing is that the video always ends up centered on the screen rather than filling both sides. Any assistance would be greatly appreciated! :(

Answer №1

Eliminate the width and height attributes that are currently set on the iframe. Instead, include a CSS rule to adjust the position of the iframe to absolute positioning using the following code snippet:

.iframe-box iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}
<div class="box iframe-box">
   <iframe src="http://player.vimeo.com/video/67794477?title=0&amp;byline=0&amp;portrait=0&amp;color=0fb0d4" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>

Answer №2

If you want the element to cover the entire screen, simply include the following CSS properties:

position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;

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

Steps for adding a React Class Component into a Modal that is not within the React Tree

Our project is built using PHP MVC Framework and we initially used jQuery as our main JavaScript framework for handling UI activities. However, we have now transitioned to using React.js. My query is about how to inject or append a React Functional/Class-b ...

Refreshing Slickgrid: Updating grid data with data fetched from an AJAX source

Within the app I am developing, there exists a data grid alongside select boxes that allow users to set filters. Upon selection of these filters, an AJAX call is made to retrieve a new array of data from the server. The challenge I currently face is wipin ...

Exploring the gridview with JQuery to iterate through and verify if any checkboxes have been selected

I am currently working on a jQuery-based application. In this application, I have an ASP.net GridView that contains checkboxes in each row. My goal is to determine whether any of the checkboxes are checked or not. Below is the code snippet where I loop thr ...

Edit CSS attributes within Angular 2+ framework

When using jQuery, we have the ability to do the following: JQuery('.someStyle') .css({"background", "red"}) This allows us to directly change the CSS property in style. While working with Angular 2+, we can use [style.<property>] for ...

What are the essential files needed in Kendo UI Core for a mobile app?

Several months ago, I created a trial Kendo mobile app but now I want to verify it using the most recent version of Kendo UI Core. In my previous project, I referenced the following files: <link href="../styles/kendo.common.min.css" rel="stylesheet" / ...

How can I add a new entry to the MySQL echo database table?

After setting up an echo mysql table for my contacts, I found that I needed a button to add a new contact. I experimented with various solutions and here is what I came up with (all code is within the same file): PHP: //create record if (isset($_POST[&ap ...

Convert PHP function output to HTML element

Check out the content of my Class.php file: <?php class Class { public function validate() { if(empty($_POST['first_name'])) { return 'first name should not be empty!'; } elseif(em ...

When clicking on a link in React, initiate the download of a text file

Usually, I can use the following line to initiate the download of files: <a href={require("../path/to/file.pdf")} download="myFile">Download file</a> However, when dealing with plain text files like a .txt file, clicking on ...

Exploring the boundaries of React's useContext functionality

In my applications, I specialize in creating custom hooks for accessing state stores. For example, I typically define the hook like this: const store = new Store(); const StoreContext = createContext(store); StoreContext.displayName = "StoreContext"; fun ...

Trigger a JavaScript/jQuery event using code instead of user interaction

Exploring the source code of a website has sparked my curiosity about how to programmatically activate the ajax autocomplete feature on a specific text box. Here is the snippet of relevant code that I have been examining: html: <div class="input-text ...

Eliminating extra space below the footer using CSS in Wordpress site

After recently updating my website, I am struggling with some of the finer points. It's worth noting that I lack experience in web development, despite working in the software field; I am trying to broaden my knowledge. In particular, I have noticed ...

reveal or conceal content on hover of mouse pointer

I am currently working on a section that functions like jQuery tabs, but instead of requiring a click to activate, I want it to work on mouse hover. The current implementation is somewhat buggy - when hovering over a specific section, it displays as expe ...

Vue automatically populates an empty array with an Observer object

I have been attempting to create an empty array in the data and then fetch a JSON from the server to populate it. The issue I am encountering is that the array consistently includes an extra Observer object, so when I log it, I see: empty items array: ...

Media query causing margin on previous div due to padding on following div

Currently experimenting with media queries and trying to make my tags span 100% the width of the device. However, I'm noticing a margin on the right side of my image. I suspect it's due to the padding on the div above, as when I set the padding t ...

What is the best approach to link an HTML document to a MySQL Workbench server utilizing JavaScript, Ajax, and PHP?

On my HTML page, users can enter the name of a movie and if it is found in the database, the name will be displayed. I am attempting to establish a connection to the MySQL Workbench Server using JavaScript, Ajax, and PHP. This is what I have implemented s ...

angular-recaptcha: Adjusting language based on the website's language update

My website offers three different languages that users can switch between. The language switch functionality is implemented on the client side using JavaScript (AngularJS). I have integrated reCAPTCHA 2 into my website and now I need to update the languag ...

Why is this loop in jQuery executing twice?

$(document).bind("ready", function(){ // Looping through each "construct" tag $('construct').each( alert('running'); function () { // Extracting data var jC2_events = $(this).html().spl ...

Every time I try to access Heroku, I encounter an issue with Strapi and the H10 error code

Upon opening Heroku and running the command "heroku logs --tail", my app encountered a crash and I can't seem to locate my Strapi application in Heroku. 2020-05-04T19:05:38.602418+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GE ...

Div element positioned outside of another div element

I hate to bug you with more css issues, but I'm really struggling with this one. The problem I'm facing is that a sub div is overflowing the boundaries of its parent div. I tried using: display: inline-block;` but then the outer div goes haywir ...

Exploring the process of obtaining a URL using getStaticPaths in Next.js

I am facing difficulty getting the URL in getStaticPath export const getStaticPaths = async (props) => { if (url === 'blah') { return { paths: [ { params: { pid: "create" } }, ], fallback: true, }; ...