I am seeking guidance on how to create a video or div that remains fixed in a specific position while adjusting its size to always match the browser window. You can see an example of what I am aiming for here.
The website mentioned above contains a video as its background, and when you resize the browser window, the video adjusts accordingly. This is the effect I am trying to achieve.
Below is the code I have implemented:
#menuContainer{
width:650px;
height:50px;
position:relative;
z-index:3;
margin-top:0;
margin-right:auto;
margin-bottom:0;
margin-left:auto;
background-color:rgb(183, 52, 178);
}
#menuLogo2{
height:50px;
width:126px;
}
#menuDevide1{
width:1px;
height:45px;
background-color:black;
position:relative;
top:-47.5px;
left:131px;
margin-top:auto;
margin-right:0;
margin-bottom:auto;
margin-left:0;
}
...
#mainOverlay{
position:absolute;
top:0px;
left: 0px;
heightx:100%;
height:100%;
background-color: rgba(0,0,0,0.3);
}
For a different view, you may want to explore this JSfiddle.
Please note that I have used their video as a placeholder and do not intend to infringe on their work.
ISSUE DETECTED POST MAIN FIX
After resolving the main problem, I noticed a narrow grey edge appearing on the right side when resizing the browser window to the left. The issue seems to disappear when resizing to the right. For a visual representation, refer to this image or check out this JSfiddle. Any assistance in rectifying this matter would be greatly appreciated!
You might find it beneficial to copy the code from JSfiddle and save them in files on your computer. The appearance might seem odd in JSfiddle but should display correctly in web browsers.