I've been experimenting with a fantastic technique by Chris Coyier for implementing full page video backgrounds with content scrolling over the video. However, I've encountered an issue where there's an unexpected gap to the right in Windows browsers. Oddly enough, this problem does not occur in Mac browsers (I've tested on Safari, Firefox, and Chrome). The gap persists across all Windows browsers that I've tested.
The CSS code for the main white content area is as follows:
main {
background: white;
position: relative;
padding: 1rem;
margin-top: 100vh;
}
main::before {
content: "";
width: 100vw;
height: 100vh;
position: absolute;
left: 0;
top: -100vh;
}
Could this be related to the scrollbar? Has anyone found a solution to this issue or can shed light on why it specifically affects Windows browsers?
Here is the link to the Fiddle for reference: https://jsfiddle.net/8y2v79nj/
Check out Chris' original article here: https://css-tricks.com/full-page-background-video-styles/
I'm using Chris' example from Codepen: https://codepen.io/chriscoyier/pen/BRvdgK
Screenshot of Mac display without the gap: https://i.stack.imgur.com/pyfIM.png
Screenshot of Windows display showing the unwanted gap: https://i.stack.imgur.com/S7djM.png