Resolve the issue of YouTube embeds being cut off

I'm having an issue with embedding a YouTube video on my website where it is clipping through the content.

Image : https://i.sstatic.net/mT5b8.png

.topnav {
  overflow: hidden;
  display: flex;
  justify-content: center;
  
}

.container {
  min-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
    flex-direction: column; 
}
.topnav a {
  float: left;
  color: red;
  text-align: center;
  padding: 14px 14px;
  text-decoration: none;
  font-size: 23px;
  border-style: solid;
  text-shadow: #000 0px 0px 1px,   #000 0px 0px 1px,   #000 0px 0px 1px, #000 0px 0px 1px,   #000 0px 0px 1px,   #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px;
  margin-top: 215px;
}

.topnav a:hover {
  background-color: #ddd;
  color: black;
}
.menu{
    cursor: pointer;
}
.aboutp{
    width: 1000px;
    text-align: center;
    display: block;
    margin:auto;
}
.mario{
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 20vw;
    margin: auto;
}
.topContent{
    background-color: red;
    height: 10vh;
    width: 70vw;
    max-width: 700px;
    max-height: 200px;
    margin: auto;
    justify-content: center;
    align-items: center;
    display: flex;
    font-size: 1.5vh;
    border-style: solid;
}
.mainContent{
    height: 100%;
    width: 100%;
    margin: 0 auto 50px;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 1.5vh;
    max-width: 768px;

}

.left {
    width:15%;
    float: left;
}

.right{
    width:15%;
}

.center {
    width:65%;
    background-color: antiquewhite;
    display: flex;
    margin-bottom: 50px;
    align-items: center;
    flex-direction: column;
    border-style: solid;
}

.bottom {
    background-color: red;
    width: 100%;
    max-width: 768px;
    max-height: 200px;
    display: flex;
    border-style: solid;
}

.bottom a {
    display: flex;
    justify-content: center;
    color: white;
    padding: 2vh;
    width: 768px;
    text-decoration: none;
    font-size: 2vh;
    border-right: 2px solid black;
    text-shadow: #000 0px 0px 1px,   #000 0px 0px 1px,   #000 0px 0px 1px, #000 0px 0px 1px,   #000 0px 0px 1px,   #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px;

}
<div class = "topContent">
        <h1>Game History</h1>
    </div>
<div class = "mainContent">
        <div class="left">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/JO86YAiYFjc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
        </div>
        <div class="center">
            <p class="aboutp1">
                 bunch of text
            </p>
            <p class="aboutp2"> 
                      bunch of text
                <img src="../resources/mario-super.gif" alt="Mario Gif" class="mariogif">
                      bunch of text
            </p>

            <p class="aboutp3">
                  bunch of text
                         </p>
            <p class="aboutp4">      
                            bunch of text
                            </p>
            <p class="aboutp5">
                  bunch of text
                                 </p>
                
        </div>
        <div class="right"><img src="../resources/mario.png" alt="Mario Image" class="mario"></div>

    
    <div class="bottom">
        </div>
    
</div>

The embedded video is overlapping with the text content on the website. I'd like to position it on the left side without affecting the other elements.

My goal is to have the embed file centered on the left side of the screen.

Answer №1

To display content on top of another, you can utilize the CSS z-index property.
This will position your content above other elements in the code.

    .mainContent{
        height: 100%;
        width: 100%;
        margin: 0 auto 50px;
        justify-content: center;
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        font-size: 1.5vh;
        max-width: 768px;
        z-index: 2;
    }

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

Linking to a specific div within a Vue.js component

Currently working on a Vue.js project, I am encountering an issue with linking an anchor to a specific div within a component. The anchor in question is as follows: <a href="#porto" class="porto-button">Porto, Portugal</a> Accompanied by the ...

What is the best way to present information retrieved from a database using ASP.NET and HTML?

I have written a query to fetch a list of items from a database: CREATE PROCEDURE dbo.GetSubjects(@DayComing varchar(10) , @UserId varchar(3)) AS IF EXISTS( SELECT Std_ID FROM Student WHERE Std_ID = @UserID) BEG ...

When I click on my div, the color does not change as expected

Recently, I wrote a code snippet where there are 9 different div elements each assigned a ".spaces" class. The intention was to change the color of these divs upon clicking on them. However, I encountered an issue where only the first div changes its color ...

how to use AngularJS filter and ng-options to format specific options as bold in a select dropdown

I am currently utilizing AngularJS ng-options to populate specific select elements. I am interested in bolding and disabling certain options. Despite trying to achieve this using the filter along with ng-options, I have been unsuccessful so far. While I ca ...

Show random images of different sizes by employing jquery

I am seeking a solution for my webpage which currently loads a random image from an array and centers it using negative margins in CSS. While this method works fine with images of the same size, I am looking to modify the code so that it can handle images ...

Changing the background-color with CSS class toggling

I'm having an issue with an element that is supposed to change its background color from "lightGreen" to "red" upon hovering. However, even though the class is being added properly, the color remains lightGreen. It's worth noting that the elemen ...

Arrange the assortment of varying sized badges in a straight line

I have a variety of badges representing users. Some users have images displayed as blocks while others are represented by text inline. https://i.sstatic.net/BtDgo.png Within the container, we have the following structure: <div class="align-self-cente ...

Divergence in image positioning with CSS on Firefox and Chrome

My struggle lies in achieving image alignment consistency across different web browsers: https://i.sstatic.net/367Dz.jpg I suspect it may be an issue with the borders? Query: Should I resort to using a media query to tackle this issue effectively? Curre ...

Applying CSS to Align List Items to the Left with Word Wrap

Over at my blog page qavalidation.com, I am faced with an issue related to the alignment of vertical menus with links. When word wrap is applied, there seems to be a misalignment in the left indentation. Can someone provide guidance on the correct CSS sty ...

Rmarkdown, displaying tables without revealing the underlying latex code in the final output

I've encountered a problem with my rmarkdown code - the table output is not displaying and appears blank. I'm stumped on how to fix this issue. title: "Title" output: html_document: default pdf_document: default header-includes: - & ...

Children of unrelated parents may have similar height levels

Is there a way to make two unrelated divs have the same height using jQuery? Most solutions I found are for children of the same parent, but in this case, I need to equalize the heights of Parent B's child to Parent A's child. The code snippet be ...

How to make divs occupy the entire space of a parent div?

I've been scouring the website for a solution, but nothing I've found has been helpful. I'm attempting to create a grid within a containing div where a default (and eventually user-specified) number of divs will fill up the space. I'm t ...

Display or conceal a <div> segment based on the drop down selection made

A dropdown menu controls the visibility of certain div elements based on the selection made. While this functionality is working for one dropdown, it's not working for another even though the code is very similar. I've tried various solutions but ...

Tips for customizing the calendar icon on a date input in Firefox versions greater than 108

Prior to version 109, Firefox allowed for the selection of the date picker's icon similar to Chromium: input[type="date"]::-webkit-calendar-picker-indicator { display: none; /* Hides the icon in Chrome and Firefox < v109 */ } This func ...

Trouble getting CSS to apply on AJAX response

I am struggling to get the external CSS to apply on ajax response. I have a page where users select options in a form and submit it, triggering another form to load via ajax. However, the CSS styles are not being applied to the ajax response. If you spot a ...

Find elements that are not contained within an element with a specific class

Imagine having this HTML snippet: <div class="test"> <div class="class1"> <input type="text" data-required="true"/> </div> <input type="text" data-required="true"/> </div> I'm looking to select ...

Show the full-size image in a web browser with its true dimensions

Currently, I am faced with the challenge of showcasing an image on a web browser with specific dimensions - 2200px width and 1600px height. The issue is that the image is being displayed by zooming in, with only one zoom option available as default. My g ...

Bootstrap troubleshoot: Solving grid and card complications

I have nearly completed a crucial section in my Django project by implementing panels that contain a set of cards. Using Bootstrap 3 (BS3), I have integrated cards from BS4 into BS3. Encountering a peculiar issue, I seek advice from the community due to t ...

Designing a Bootstrap layout with twin divs adjacent to each other

I am trying to design a webpage with two Divs positioned side by side using bootstrap styles. However, the code I have been using is not yielding the desired outcome. Is there anyone who can offer me some guidance on how to achieve this? Thank you. < ...

CSS files that are isolated are not functioning properly for EditForm Inputs

Suppose I have the elements below on a MyComponent.razor file: <label class="form-label" for="myInput">Text Field</label> <InputText class="form-control" id="myInput" @bind-Value="@Something" ...