Margin Snow Stripe

Having trouble troubleshooting a margin error that won't go away? I've attempted adjusting the margin and padding values to 0, but the line persists. Should I consider resizing the video?

I placed the background video within a div tag. Is the video not aligning correctly?

https://i.sstatic.net/XLhZ5.png

    /* Code snippet to manage video display */
#video{display:none}

/* Default image display on all devices */
#videosubstitute{display:block;width:auto;height:100%;}


html, body {
    height: 100%;
    margin: 0;

}


/*START VIDEO
==================================================*/
#fullScreenDiv{
    width:100vh;
    min-height: 100vh; 
    /* Set the height to match that of the viewport. */
    height: 100vh;
    width: auto;
    padding:0!important;
    margin: 0!important;
    background-color: black;
    position: relative;

}
#video{    
    width: 100vw; 
    height: auto;
    object-fit: cover;
    left: 0px;
    top: 0px;
    z-index: 1;
    volume: .02;
}

@media (min-aspect-ratio: 16/9) {
  #video{
    height: 150%;
    top: -100%;
  }
  #videosubstitute{
    display:block;
    width: 100%;
    height: auto;}
}

@media (max-aspect-ratio: 16/9) {
  #video {
    width: 150%;
    left: -100%;
  }
  #videosubstitute{display:block;width:auto;height:100%;}
}
/* Display video, hide image if screen size is 992 pixels or more */
@media only screen and (min-width : 992px) {
#video{display:block;}
#videosubstitute{display:none}
}   

/* Text container styles */
#messageBox{
    position: absolute;  top: 0;  left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height:100%;
}

/*END VIDEO
==================================================*/
<div id="fullScreenDiv" class="table-cell">

            <img src="https://www.imi21.com/wp-content/uploads/2016/11/t12.jpg" id="videosubstitute" alt="Full screen background video"></img>

        <div id="videoDiv">           
            <video preload="preload" id="video" autoplay="autoplay" loop="loop">
            <!-- Note: Replacing the following sources that are local:
            <source src="img/mc10.webm" type="video/webm"></source>
            <source src="img/mc10.mp4" type="video/mp4"></source> -->
            <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"></source>
            </video>
        </div>
</div>

Answer №1

This line just doesn't look right:

width:100vh;

The unit vh represents a percentage of the screen height. It might not be the best choice for setting width.

Have you considered whether it's necessary for the video to be cropped at the edges of the screen? Perhaps having a black background and allowing the video to fill the available space without distortion would be a better approach. For example, using fill: contain.

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

I am encountering an issue where I am unable to access properties of null while trying to read the 'pulsate' function within the

The current version of my material-ui library is as follows: "@mui/icons-material": "^5.5.1", "@mui/material": "^5.5.1", This is how I included the Button component : import Button from "@mui/material/Button&qu ...

Issues with aligning div elements centrally

I have a dilemma with aligning two divs on my webpage. I am trying to position the second div in such a way that it is centered between the first div and the end of the page, like this: | | | | | | | | | | | | | | div1 | ...

Combining the Powers of Magento and Wordpress: Can I manually edit a page or the CSS?

I am currently faced with the challenge of editing a webpage that was not originally created by me. I have been tasked with understanding someone else's code in order to make alterations. Specifically, I am attempting to change the font color on the h ...

Retrieving Information From SVG Files

I have this code snippet saved in a local HTML file: <object id="PriceAdvisorFrame" type="image/svg+xml" data="https://www.kbb.com/Api/3.9.448.0/71071/vehicle/upa/PriceAdvisor/meter.svg?action=Get&amp;intent=buy-used&amp;pricetype=Private Party ...

The functionality of overflow:scroll is not functioning properly on Android smartphones

Hey there! I've been trying to implement scrolling in my application using overflow:scroll, but it seems that it's not working on Android mobile phones. After some research, I discovered that Android version 3.0 and below does not support overflo ...

The Bootstrap Modal will still appear even in the presence of a validation error

Recently, I created a sign-up page using HTML and Bootstrap 5. To ensure data validation on the form, I integrated Bootstrap's validation feature. However, after completing the registration process, a modal pops up as intended. The only issue is that ...

Animated Content Sliding out Smoothly from Right to Left Using jQuery

I am attempting to implement a slideout function from the right side using jQuery. I have tried modifying the code for "From Left to Right" but it doesn't seem to be working correctly. Can you please provide me with guidance on how to make the necessa ...

Add elements to a ul element using JavaScript and make the changes permanent

Managing a dashboard website with multiple div elements can be quite tedious, especially when daily updates are required. Manually editing the HTML code is inefficient and time-consuming. Each div contains a ul element where new li items need to be added ...

Is it possible to use WHILE loops twice in PHP?

Just starting out with PHP and hoping for some assistance. I have a MySQL database table with columns for "id", "img", "link", and "desc". My goal is to echo all of this data in the following format: <div id="featured"> <a target='_b ...

Ways to transfer the data from one HTML document to another HTML document

I am looking to automate the process of filling out a form on one HTML page, then transferring the completed form to another HTML page for verification and storage. I am having trouble figuring out how to send the form data from one HTML page to another. ...

Using Responsive Design with Bootstrap and Media Queries

As a beginner in front-end development, I have recently learned about media queries and their functionality. Having previously studied Bootstrap, I can't help but wonder if media queries are actually necessary. After all, Bootstrap seems to offer simi ...

The Infinite scroll feature in Fuel UX is ineffective when a specific height is not defined for the

In my current project, I am utilizing Bootstrap and Fuel UX v3.4.0 with the goal of implementing Infinite scroll throughout my entire page. Unfortunately, I have encountered difficulties in achieving this implementation. By replicating the infinite scroll ...

Iterate through the loop to add data to the table

Looking for a way to append table data stored in local storage, I attempted to use a loop to add cells while changing the numbers based on row counts. Here is my JavaScript code snippet: $(function() { $("#loadTask").change(function() { var ta ...

Navigating around web pages with Python and Selenium: How to interact with non-button elements through clicking

I am currently working with Python's selenium library and trying to interact with an element that is not of the button class. My browser/web driver setup involves Google Chrome. Below is my code snippet for reference: from selenium import webdriver ...

php receiving the selected value from a dropdown list in the action

I am aiming to retrieve two drop-down values and then 1. pass them to the `action` function and 2. send them to the next `.php` page using `$_POST`. Essentially, I want to choose the php `action` with a drop-down menu. Where am I going wrong? When I selec ...

I can't get Toggleclass to switch classes properly, am I missing something?

I have been experimenting with creating a button that toggles a class and reveals another div below it. Feel free to check out the example on jsFiddle that I created for you. While the first function of showing and hiding the div is working perfectly, I ...

Generating numerous div elements with jQuery's zIndex property

While attempting to create a function that runs on the $(document).ready() event and is supposed to generate a new div, I encountered an issue. Whenever I try to create another div with the same DOM and Class attributes but in a different position, a probl ...

jQuery - delete a single word that is case-sensitive

Is there a way to eliminate a specific case-sensitive word from a fully loaded webpage? The word in question is "Posts" and it appears within a div called #pd_top_rated_holder that is generated by Javascript. The Javascript code is sourced externally, so ...

Extend the width of a div element to fit the size of its absolutely positioned

I am facing an issue with a Div that contains multiple absolutely positioned divs. The clickable area of the main div expands to cover the children, but the drawn area does not. I need the drawn area to encompass all the container divs. You can view a JSF ...

Managing information in a fresh window from the main source

I'm looking to use the window open() function to display a default calibration image initially Then have the ability to switch out images from a gallery on the parent page whenever needed My coding skills are a bit rusty, and I'm struggling to ...